import { request } from './utils' ; interface payloadProps { id : string ; data ? : object ; } export async function fetch ( payload ) { const { id } = payload ; let url = '/accountUserSelf/getUserData' ; if ( ! id ) { return ; } return request ( url , { method : 'GET' , data : { dataId : id , dataType : 'dashboard' , } , } ) ; } export async function update ( payload ) { const { id , data } = payload ; let url = '/accountUserSelf/setUserData' ; if ( ! id ) { return ; } return request ( url , { method : 'POST' , data : { dataId : id , dataType : 'dashboard' , bigData : JSON . stringify ( data ) , } , } ) ; } export function removeWidgetApi ( params ) { const { widgetKey } = params ; let url = '/accountUserSelf/delUserData' ; return request ( url , { method : 'DELETE' , data : { dataId : widgetKey , dataType : 'widget' , } , } ) ; }