dify/web/service/explore.ts

34 lines
672 B
TypeScript
Raw Normal View History

import { del, get, patch, post } from './base'
2023-05-25 16:59:47 +08:00
export const fetchAppList = () => {
return get('/explore/apps')
}
export const fetchAppDetail = (id: string): Promise<any> => {
2023-05-25 16:59:47 +08:00
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,
},
2023-05-25 16:59:47 +08:00
})
}
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,
},
2023-05-25 16:59:47 +08:00
})
}