refactor(client-side): modify form story+chapter types
chapters now have an optional id (for use when editing), and `fileName` has been simplified to `file`
This commit is contained in:
parent
d056dac72b
commit
04e769ea90
@ -1,4 +1,7 @@
|
||||
import { V4Options, v4 } from "uuid";
|
||||
|
||||
export interface FormChapter {
|
||||
id?: number;
|
||||
chapterTitle: string;
|
||||
index: number;
|
||||
summary: string;
|
||||
@ -11,7 +14,8 @@ export interface FormChapter {
|
||||
loggedInOnly: boolean;
|
||||
hidden: boolean;
|
||||
content: string;
|
||||
fileName: string;
|
||||
file?: string;
|
||||
uuidKey: string;
|
||||
}
|
||||
|
||||
export interface FormStory {
|
||||
@ -19,6 +23,7 @@ export interface FormStory {
|
||||
chapters: FormChapter[];
|
||||
ficmas?: number | null;
|
||||
challenge?: number | null;
|
||||
completed: boolean;
|
||||
}
|
||||
|
||||
export const defaultChapter: FormChapter = {
|
||||
@ -34,12 +39,13 @@ export const defaultChapter: FormChapter = {
|
||||
loggedInOnly: true,
|
||||
hidden: false,
|
||||
content: "",
|
||||
fileName: ""
|
||||
}
|
||||
uuidKey: v4(),
|
||||
};
|
||||
|
||||
export const defaultStory: FormStory = {
|
||||
title: "",
|
||||
chapters: [],
|
||||
ficmas: null,
|
||||
challenge: null,
|
||||
}
|
||||
completed: false,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user