22 lines
495 B
TypeScript
Raw Normal View History

2025-04-30 00:17:09 +08:00
import http from '@core/http';
import type { SceneDetail, SceneInfo } from './type';
2025-04-29 20:08:08 +08:00
const enum API {
= '/scene/getById',
}
2025-04-30 00:17:09 +08:00
export async function getSceneById(id: SceneInfo['id']): Promise<SceneDetail | null> {
if (!id) return null;
type B = { id: string };
type D = SceneDetail;
2025-05-05 01:06:09 +08:00
try {
const body = { id };
const data = await http.post<D, B>(API., body);
return data ?? null;
} catch (error) {
console.debug(error);
return null;
}
2025-04-30 00:17:09 +08:00
}