import request from '@/utils/request';
import { AxiosPromise } from 'axios';

// Get Home App List
export function getHomeApp(): AxiosPromise<any> {
  return request({
    url: '/app-centre/manage/getHomeApp',
    method: 'post'
  });
}

// Jump to Page
export function jumpToPage(pageId: number): AxiosPromise<any> {
  return request({
    url: '/app-centre/manage/jumpToPage',
    method: 'post',
    params: { pageId }
  });
}

// Update Icon
export interface UpdateIconParams {
  id: number;
  iconName: string;
}

export function updateIcon(params: UpdateIconParams): AxiosPromise<any> {
  return request({
    url: '/app-centre/manage/editeIcon',
    method: 'post',
    data: params
  });
}
