fix: create post

This commit is contained in:
yanghao05
2025-04-09 20:32:31 +08:00
parent 05d2ecc2b9
commit 2346983d67
10 changed files with 192 additions and 95 deletions

View File

@@ -27,7 +27,7 @@ httpClient.interceptors.request.use(
// Response interceptor
httpClient.interceptors.response.use(
response => {
return response.data;
return response
},
error => {
// Handle HTTP errors here

View File

@@ -13,4 +13,14 @@ export const postService = {
getPost(id) {
return httpClient.get(`/admin/posts/${id}`);
},
};
createPost(post) {
return httpClient.post('/admin/posts', post);
},
updatePost(id, post) {
return httpClient.put(`/admin/posts/${id}`, post);
},
deletePost(id) {
return httpClient.delete(`/admin/posts/${id}`);
},
}