can add image to message
This commit is contained in:
@@ -164,9 +164,12 @@ export const authAPI = {
|
||||
getStatus: () => api.get("/auth/status"),
|
||||
verifyEmail: (token: string) => api.post("/auth/verify-email", { token }),
|
||||
resendVerification: () => api.post("/auth/resend-verification"),
|
||||
forgotPassword: (email: string) => api.post("/auth/forgot-password", { email }),
|
||||
verifyResetToken: (token: string) => api.post("/auth/verify-reset-token", { token }),
|
||||
resetPassword: (token: string, newPassword: string) => api.post("/auth/reset-password", { token, newPassword }),
|
||||
forgotPassword: (email: string) =>
|
||||
api.post("/auth/forgot-password", { email }),
|
||||
verifyResetToken: (token: string) =>
|
||||
api.post("/auth/verify-reset-token", { token }),
|
||||
resetPassword: (token: string, newPassword: string) =>
|
||||
api.post("/auth/reset-password", { token, newPassword }),
|
||||
};
|
||||
|
||||
export const userAPI = {
|
||||
@@ -241,7 +244,12 @@ export const messageAPI = {
|
||||
getSentMessages: () => api.get("/messages/sent"),
|
||||
getConversations: () => api.get("/messages/conversations"),
|
||||
getMessage: (id: string) => api.get(`/messages/${id}`),
|
||||
sendMessage: (data: any) => api.post("/messages", data),
|
||||
sendMessage: (formData: FormData) =>
|
||||
api.post("/messages", formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
},
|
||||
}),
|
||||
markAsRead: (id: string) => api.put(`/messages/${id}/read`),
|
||||
getUnreadCount: () => api.get("/messages/unread/count"),
|
||||
};
|
||||
@@ -304,4 +312,8 @@ export const feedbackAPI = {
|
||||
api.post("/feedback", data),
|
||||
};
|
||||
|
||||
// Helper to construct message image URLs
|
||||
export const getMessageImageUrl = (imagePath: string) =>
|
||||
`${API_BASE_URL}/messages/images/${imagePath}`;
|
||||
|
||||
export default api;
|
||||
|
||||
Reference in New Issue
Block a user