import request from 'umi-request'; import { BasicListItemDataType } from './data'; interface ParamsType extends Partial { count?: number; } export async function queryFakeList(params: ParamsType) { return request('/api/BLOCK_NAME/fake_list', { params, }); } export async function removeFakeList(params: ParamsType) { const { count = 5, ...restParams } = params; return request('/api/BLOCK_NAME/fake_list', { method: 'POST', params: { count, }, data: { ...restParams, method: 'delete', }, }); } export async function addFakeList(params: ParamsType) { const { count = 5, ...restParams } = params; return request('/api/BLOCK_NAME/fake_list', { method: 'POST', params: { count, }, data: { ...restParams, method: 'post', }, }); } export async function updateFakeList(params: ParamsType) { const { count = 5, ...restParams } = params; return request('/api/BLOCK_NAME/fake_list', { method: 'POST', params: { count, }, data: { ...restParams, method: 'update', }, }); }