methodology.ts
1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { apiClient } from './client';
export type MethodologyStatus = 'enable' | 'disable';
export type MediaType = 'gif' | 'mp4';
export type ImageType = 'png' | 'jpg' | 'jpeg';
export interface MethodologyStep {
step_id: string;
step_icon: string;
step_name: string;
step_order: number;
step_image: string;
}
export interface MethodologyConfig {
config_id: string;
display_status: MethodologyStatus;
main_title: string;
sub_title: string;
steps: MethodologyStep[];
updated_at?: string;
}
export interface SaveMethodologyStepPayload {
step_icon: string;
step_name: string;
step_order: number;
step_image: string;
}
export interface SaveMethodologyPayload {
display_status: MethodologyStatus;
main_title: string;
sub_title: string;
steps: SaveMethodologyStepPayload[];
}
export interface SaveMethodologyResponse {
config_id: string;
updated_at: string;
}
export interface UploadMethodologyAssetResponse {
file_id: string;
file_url: string;
file_type: MediaType | ImageType;
file_size: number;
extracted_text?: string;
session_id?: string;
}
export async function getMethodologyConfig(): Promise<MethodologyConfig> {
return apiClient.get<MethodologyConfig>('/official-site/methodology');
}
export async function saveMethodologyConfig(payload: SaveMethodologyPayload): Promise<SaveMethodologyResponse> {
return apiClient.post<SaveMethodologyResponse>('/official-site/methodology', payload);
}
export async function uploadMethodologyAsset(formData: FormData): Promise<UploadMethodologyAssetResponse> {
return apiClient.post<UploadMethodologyAssetResponse>('/official-site/upload', formData);
}