This commit is contained in:
jeremygan2021
2026-02-12 19:40:59 +08:00
parent eb8957af91
commit 1f1516ae20
11 changed files with 772 additions and 20 deletions

View File

@@ -39,9 +39,18 @@ export const createTopic = (data: any) => request({ url: '/community/topics/', m
export const updateTopic = (id: number, data: any) => request({ url: `/community/topics/${id}/`, method: 'PATCH', data })
export const getReplies = (params: any) => request({ url: '/community/replies/', data: params })
export const createReply = (data: any) => request({ url: '/community/replies/', method: 'POST', data })
export const updateReply = (id: number, data: any) => request({ url: `/community/replies/${id}/`, method: 'PATCH', data })
export const deleteReply = (id: number) => request({ url: `/community/replies/${id}/`, method: 'DELETE' })
export const deleteTopic = (id: number) => request({ url: `/community/topics/${id}/`, method: 'DELETE' })
export const getStarUsers = () => request({ url: '/users/stars/' })
export const getAnnouncements = () => request({ url: '/community/announcements/' })
// Activities
export const getActivities = () => request({ url: '/community/activities/' })
export const getActivityDetail = (id: number) => request({ url: `/community/activities/${id}/` })
export const signupActivity = (id: number) => request({ url: `/community/activities/${id}/signup/`, method: 'POST' })
export const getMySignups = () => request({ url: '/community/activities/my_signups/' })
// Upload Media for Forum
export const uploadMedia = (filePath: string, type: 'image' | 'video') => {
const BASE_URL = process.env.TARO_APP_API_URL || 'https://market.quant-speed.com/api'