36 lines
745 B
TypeScript
36 lines
745 B
TypeScript
import { requestJson } from './apiClient';
|
|
|
|
export type CreationEntryTypeConfig = {
|
|
id: string;
|
|
title: string;
|
|
subtitle: string;
|
|
badge: string;
|
|
imageSrc: string;
|
|
visible: boolean;
|
|
open: boolean;
|
|
sortOrder: number;
|
|
updatedAtMicros: number;
|
|
};
|
|
|
|
export type CreationEntryConfig = {
|
|
startCard: {
|
|
title: string;
|
|
description: string;
|
|
idleBadge: string;
|
|
busyBadge: string;
|
|
};
|
|
typeModal: {
|
|
title: string;
|
|
description: string;
|
|
};
|
|
creationTypes: CreationEntryTypeConfig[];
|
|
};
|
|
|
|
export async function fetchCreationEntryConfig(): Promise<CreationEntryConfig> {
|
|
return requestJson<CreationEntryConfig>(
|
|
'/api/creation-entry/config',
|
|
{ method: 'GET' },
|
|
'读取创作入口配置失败',
|
|
);
|
|
}
|