Feat/explore (#198)
This commit is contained in:
33
web/service/explore.ts
Normal file
33
web/service/explore.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { get, post, del, patch } from './base'
|
||||
|
||||
export const fetchAppList = () => {
|
||||
return get('/explore/apps')
|
||||
}
|
||||
|
||||
export const fetchAppDetail = (id: string) : Promise<any> => {
|
||||
return get(`/explore/apps/${id}`)
|
||||
}
|
||||
|
||||
export const fetchInstalledAppList = () => {
|
||||
return get('/installed-apps')
|
||||
}
|
||||
|
||||
export const installApp = (id: string) => {
|
||||
return post('/installed-apps', {
|
||||
body: {
|
||||
app_id: id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const uninstallApp = (id: string) => {
|
||||
return del(`/installed-apps/${id}`)
|
||||
}
|
||||
|
||||
export const updatePinStatus = (id: string, isPinned: boolean) => {
|
||||
return patch(`/installed-apps/${id}`, {
|
||||
body: {
|
||||
is_pinned: isPinned
|
||||
}
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user