mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
c67f626b66
Co-authored-by: John Wang <takatost@gmail.com> Co-authored-by: Jyong <718720800@qq.com> Co-authored-by: 金伟强 <iamjoel007@gmail.com>
34 lines
672 B
TypeScript
34 lines
672 B
TypeScript
import { del, get, patch, post } 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,
|
|
},
|
|
})
|
|
}
|