essential forum code
This commit is contained in:
@@ -254,18 +254,22 @@ export const messageAPI = {
|
||||
getUnreadCount: () => api.get("/messages/unread/count"),
|
||||
};
|
||||
|
||||
export const itemRequestAPI = {
|
||||
getItemRequests: (params?: any) => api.get("/item-requests", { params }),
|
||||
getItemRequest: (id: string) => api.get(`/item-requests/${id}`),
|
||||
createItemRequest: (data: any) => api.post("/item-requests", data),
|
||||
updateItemRequest: (id: string, data: any) =>
|
||||
api.put(`/item-requests/${id}`, data),
|
||||
deleteItemRequest: (id: string) => api.delete(`/item-requests/${id}`),
|
||||
getMyRequests: () => api.get("/item-requests/my-requests"),
|
||||
respondToRequest: (id: string, data: any) =>
|
||||
api.post(`/item-requests/${id}/responses`, data),
|
||||
updateResponseStatus: (responseId: string, status: string) =>
|
||||
api.put(`/item-requests/responses/${responseId}/status`, { status }),
|
||||
export const forumAPI = {
|
||||
getPosts: (params?: any) => api.get("/forum/posts", { params }),
|
||||
getPost: (id: string) => api.get(`/forum/posts/${id}`),
|
||||
createPost: (data: any) => api.post("/forum/posts", data),
|
||||
updatePost: (id: string, data: any) => api.put(`/forum/posts/${id}`, data),
|
||||
deletePost: (id: string) => api.delete(`/forum/posts/${id}`),
|
||||
updatePostStatus: (id: string, status: string) =>
|
||||
api.patch(`/forum/posts/${id}/status`, { status }),
|
||||
getMyPosts: () => api.get("/forum/my-posts"),
|
||||
getTags: (params?: any) => api.get("/forum/tags", { params }),
|
||||
createComment: (postId: string, data: any) =>
|
||||
api.post(`/forum/posts/${postId}/comments`, data),
|
||||
updateComment: (commentId: string, data: any) =>
|
||||
api.put(`/forum/comments/${commentId}`, data),
|
||||
deleteComment: (commentId: string) =>
|
||||
api.delete(`/forum/comments/${commentId}`),
|
||||
};
|
||||
|
||||
export const stripeAPI = {
|
||||
|
||||
Reference in New Issue
Block a user