websockets implemented
This commit is contained in:
22
frontend/src/api/friendshipApi.js
Normal file
22
frontend/src/api/friendshipApi.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import apiClient from "@/utils/axios.js";
|
||||
|
||||
export const getFriendships = async (acceptedOnly) => {
|
||||
const response = await apiClient.get(`/api/friendships?acceptedOnly=${acceptedOnly}`);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const endFriendship = async (friendUserId) => {
|
||||
await apiClient.post("/api/friendships/end", { friendUserId });
|
||||
};
|
||||
|
||||
export const acceptFriendship = async (friendUserId) => {
|
||||
await apiClient.post("/api/friendships/accept", { friendUserId });
|
||||
};
|
||||
|
||||
export const rejectFriendship = async (friendUserId) => {
|
||||
await apiClient.post("/api/friendships/reject", { friendUserId });
|
||||
};
|
||||
|
||||
export const withdrawRequest = async (friendUserId) => {
|
||||
await apiClient.post("/api/friendships/withdraw", { friendUserId });
|
||||
};
|
||||
Reference in New Issue
Block a user