explore.ts 669 B

123456789101112131415161718192021222324252627282930313233
  1. import { get, post, del, patch } 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. }