|
@@ -7,7 +7,20 @@ import {
|
|
|
DELETE_AM_MODEL,
|
|
|
} from "./constant";
|
|
|
|
|
|
-type ServiceAnimationModel = AnimationModel;
|
|
|
+type ServiceAnimationModel = {
|
|
|
+ key?: string
|
|
|
+ id: string;
|
|
|
+ title: string;
|
|
|
+ url: string;
|
|
|
+ showTitle: boolean;
|
|
|
+ fontSize: number;
|
|
|
+ globalVisibility: boolean;
|
|
|
+ visibilityRange: number;
|
|
|
+ frames: string
|
|
|
+ actions: string
|
|
|
+ subtitles: string
|
|
|
+ paths: string
|
|
|
+}
|
|
|
|
|
|
export interface AnimationAction {
|
|
|
id: string;
|
|
@@ -73,10 +86,18 @@ export type AnimationModels = AnimationModel[];
|
|
|
|
|
|
const serviceToLocal = (serviceAM: ServiceAnimationModel): AnimationModel => ({
|
|
|
...serviceAM,
|
|
|
+ frames: JSON.parse(serviceAM.frames),
|
|
|
+ actions: JSON.parse(serviceAM.actions),
|
|
|
+ subtitles: JSON.parse(serviceAM.subtitles),
|
|
|
+ paths: JSON.parse(serviceAM.paths)
|
|
|
});
|
|
|
|
|
|
const localToService = (am: AnimationModel): ServiceAnimationModel => ({
|
|
|
...am,
|
|
|
+ frames: JSON.stringify(am.frames),
|
|
|
+ actions: JSON.stringify(am.actions),
|
|
|
+ subtitles: JSON.stringify(am.subtitles),
|
|
|
+ paths: JSON.stringify(am.paths)
|
|
|
});
|
|
|
|
|
|
export const fetchAnimationModels = async () => {
|