feat(auth): implement OTP login flow with toast notifications
feat(content): enhance detail view with dynamic content and comments feat(order): add polling for payment status in the payment view feat(user): update dashboard to display wallet and recent orders feat(user): improve orders view with dynamic order fetching and status mapping feat(api): create API modules for auth, content, order, user, and common functionalities refactor(request): implement a centralized request utility for API calls
This commit is contained in:
13
frontend/portal/src/api/content.js
Normal file
13
frontend/portal/src/api/content.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { request } from '../utils/request';
|
||||
|
||||
export const contentApi = {
|
||||
list: (params) => {
|
||||
const qs = new URLSearchParams(params).toString();
|
||||
return request(`/contents?${qs}`);
|
||||
},
|
||||
get: (id) => request(`/contents/${id}`),
|
||||
listComments: (id, page) => request(`/contents/${id}/comments?page=${page || 1}`),
|
||||
createComment: (id, data) => request(`/contents/${id}/comments`, { method: 'POST', body: data }),
|
||||
likeComment: (id) => request(`/comments/${id}/like`, { method: 'POST' }),
|
||||
listTopics: () => request('/topics'),
|
||||
};
|
||||
Reference in New Issue
Block a user