Новые изменения в компонентах
This commit is contained in:
parent
5bb4525f63
commit
d4394a7597
5 changed files with 145 additions and 34 deletions
|
|
@ -132,6 +132,15 @@ export const POST: APIRoute = async ({ request, cookies }) => {
|
|||
console.error('[ReviewVote API] Votes error:', errorText);
|
||||
}
|
||||
|
||||
await fetch(`${POCKETBASE_URL}/api/collections/reviews/records/${review_id}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Authorization': `Bearer ${token}`,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ votesCount: likes }),
|
||||
});
|
||||
|
||||
return new Response(
|
||||
JSON.stringify({ likes, dislikes, userVote }),
|
||||
{ status: 200, headers: { 'Content-Type': 'application/json' } }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue