merge: database backed creation entry config
# Conflicts: # src/components/platform-entry/PlatformEntryFlowShellImpl.tsx
This commit is contained in:
35
src/services/creationEntryConfigService.ts
Normal file
35
src/services/creationEntryConfigService.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
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' },
|
||||
'读取创作入口配置失败',
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user