explore.ts 672 B

12345678910111213141516171819202122232425262728293031323334
  1. import { del, get, patch, post } from './base'
  2. export const fetchAppList = () => {
  3. return get('/explore/apps')
  4. }
  5. export const fetchAppDetail = (id: string): Promise<any> => {
  6. return get(`/explore/apps/${id}`)
  7. }
  8. export const fetchInstalledAppList = () => {
  9. return get('/installed-apps')
  10. }
  11. export const installApp = (id: string) => {
  12. return post('/installed-apps', {
  13. body: {
  14. app_id: id,
  15. },
  16. })
  17. }
  18. export const uninstallApp = (id: string) => {
  19. return del(`/installed-apps/${id}`)
  20. }
  21. export const updatePinStatus = (id: string, isPinned: boolean) => {
  22. return patch(`/installed-apps/${id}`, {
  23. body: {
  24. is_pinned: isPinned,
  25. },
  26. })
  27. }