fix: issues

This commit is contained in:
2025-12-20 14:11:44 +08:00
parent 88d42470c4
commit 8e95dada82
17 changed files with 95 additions and 87 deletions

View File

@@ -2,7 +2,7 @@ import httpClient from './httpClient';
export const postService = {
getPosts({ page = 1, limit = 10, keyword = '' } = {}) {
return httpClient.get('/admin/posts', {
return httpClient.get('/posts', {
params: {
page,
limit,
@@ -11,19 +11,19 @@ export const postService = {
});
},
getPost(id) {
return httpClient.get(`/admin/posts/${id}`);
return httpClient.get(`/posts/${id}`);
},
createPost(post) {
return httpClient.post('/admin/posts', post);
return httpClient.post('/posts', post);
},
updatePost(id, post) {
return httpClient.put(`/admin/posts/${id}`, post);
return httpClient.put(`/posts/${id}`, post);
},
deletePost(id) {
return httpClient.delete(`/admin/posts/${id}`);
return httpClient.delete(`/posts/${id}`);
},
sendTo(id, userId) {
return httpClient.post(`/admin/posts/${id}/send-to/${userId}`);
return httpClient.post(`/posts/${id}/send-to/${userId}`);
},
}