9f127d2927
将原有的catalog.channel和catalog.all-device API文件重命名为带client前缀的新文件,新增对应API实现模块,修复all-device接口函数名的拼写错误,并更新use-channels-query组合式函数中的API调用逻辑
12 lines
468 B
TypeScript
12 lines
468 B
TypeScript
import { unwrapVimpResponse, vimpClient } from '../client';
|
|
import type { VimpChannel } from '../model';
|
|
|
|
export const clientCatalogChannelApi = async (code: string, options?: { signal?: AbortSignal }) => {
|
|
const { signal } = options ?? {};
|
|
const client = vimpClient;
|
|
const endpoint = `/client/catalog/channel`;
|
|
const resp = await client.post<VimpChannel[]>(endpoint, { code, time: '' }, { signal });
|
|
const data = unwrapVimpResponse(resp);
|
|
return data;
|
|
};
|