5656 </v-col >
5757 </template >
5858 <template #actions >
59- <v-btn density =" compact" size =" large" prepend-icon =" mdi-thumb-up" >0</v-btn >
60- <v-btn density =" compact" size =" large" prepend-icon =" mdi-thumb-down" >0</v-btn >
59+ <v-btn
60+ @click =" changeReactionLike"
61+ density =" compact"
62+ size =" large"
63+ prepend-icon =" mdi-thumb-up" >0</v-btn >
64+ <v-btn
65+ @click =" changeReactionDislike"
66+ density =" compact"
67+ size =" large"
68+ prepend-icon =" mdi-thumb-down" >0</v-btn >
6169 </template >
6270 </v-card >
6371</template >
@@ -82,6 +90,34 @@ const emit = defineEmits(['comment-deleted']);
8290const markGeneral = ref (0 );
8391const redactedText = ref <string []>([]);
8492
93+ async function changeReactionLike() {
94+ try {
95+ await apiClient .PUT (' /rating/comment/{uuid}/{reaction}' , {
96+ params: {
97+ path: {
98+ uuid: propsLocal .comment .raw .uuid ,
99+ reaction: " like"
100+ }
101+ },
102+ });
103+
104+ }catch (error ){
105+ console .error (" Ошибка лайка:" , error )
106+ }
107+
108+ }
109+ async function changeReactionDislike() {
110+ try {
111+ await apiClient .PUT (' /rating/comment/{uuid}/{reaction}' , {
112+ params: { path: { uuid: propsLocal .comment .raw .uuid ,
113+ reaction: " dislike" } },
114+ });
115+ }catch (error ){
116+ console .error (" Ошибка дизлайка:" , error )
117+ }
118+
119+ }
120+
85121async function deleteComment() {
86122 await apiClient .DELETE (' /rating/comment/{uuid}' , {
87123 params: { path: { uuid: propsLocal .comment .raw .uuid } },
0 commit comments