feat: 前端
This commit is contained in:
14
frontend/src/api/like.ts
Normal file
14
frontend/src/api/like.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { postJson } from './client'
|
||||
import type { IsLikedResponse, MessageResponse } from './types'
|
||||
|
||||
export function like(videoId: number) {
|
||||
return postJson<MessageResponse>('/like/like', { video_id: videoId }, { authRequired: true })
|
||||
}
|
||||
|
||||
export function unlike(videoId: number) {
|
||||
return postJson<MessageResponse>('/like/unlike', { video_id: videoId }, { authRequired: true })
|
||||
}
|
||||
|
||||
export function isLiked(videoId: number) {
|
||||
return postJson<IsLikedResponse>('/like/isLiked', { video_id: videoId }, { authRequired: true })
|
||||
}
|
||||
Reference in New Issue
Block a user