首个可运行的版本
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import api from './client'
|
||||
|
||||
export const friendsApi = {
|
||||
getFriends: () => api.get('/friends/'),
|
||||
|
||||
getPendingRequests: () => api.get('/friends/requests'),
|
||||
|
||||
sendRequest: (toUserId: string, message?: string) =>
|
||||
api.post('/friends/request', { to_user_id: toUserId, message }),
|
||||
|
||||
acceptRequest: (requestId: string) =>
|
||||
api.put(`/friends/request/${requestId}/accept`),
|
||||
|
||||
rejectRequest: (requestId: string) =>
|
||||
api.put(`/friends/request/${requestId}/reject`),
|
||||
|
||||
removeFriend: (friendId: string) =>
|
||||
api.delete(`/friends/${friendId}`),
|
||||
}
|
||||
Reference in New Issue
Block a user