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:
2025-12-30 21:15:13 +08:00
parent 179b6aa0e2
commit cf29a2bf1a
14 changed files with 400 additions and 310 deletions

View File

@@ -0,0 +1,24 @@
import { request } from '../utils/request';
export const creatorApi = {
apply: (data) => request('/creator/apply', { method: 'POST', body: data }),
getDashboard: () => request('/creator/dashboard'),
listContents: (params) => {
const qs = new URLSearchParams(params).toString();
return request(`/creator/contents?${qs}`);
},
createContent: (data) => request('/creator/contents', { method: 'POST', body: data }),
updateContent: (id, data) => request(`/creator/contents/${id}`, { method: 'PUT', body: data }),
deleteContent: (id) => request(`/creator/contents/${id}`, { method: 'DELETE' }),
listOrders: (params) => {
const qs = new URLSearchParams(params).toString();
return request(`/creator/orders?${qs}`);
},
refundOrder: (id, data) => request(`/creator/orders/${id}/refund`, { method: 'POST', body: data }),
getSettings: () => request('/creator/settings'),
updateSettings: (data) => request('/creator/settings', { method: 'PUT', body: data }),
listPayoutAccounts: () => request('/creator/payout-accounts'),
addPayoutAccount: (data) => request('/creator/payout-accounts', { method: 'POST', body: data }),
removePayoutAccount: (id) => request(`/creator/payout-accounts?id=${id}`, { method: 'DELETE' }),
withdraw: (data) => request('/creator/withdraw', { method: 'POST', body: data }),
};