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
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

@ -1,45 +1,51 @@
export interface FormChapter { import { V4Options, v4 } from "uuid";
chapterTitle: string;
index: number; export interface FormChapter {
summary: string; id?: number;
notes: string; chapterTitle: string;
genre: string[]; index: number;
bands: number[]; summary: string;
characters: string[]; notes: string;
relationships: string[][]; genre: string[];
nsfw: boolean; bands: number[];
loggedInOnly: boolean; characters: string[];
hidden: boolean; relationships: string[][];
content: string; nsfw: boolean;
fileName: string; loggedInOnly: boolean;
} hidden: boolean;
content: string;
export interface FormStory { file?: string;
title: string; uuidKey: string;
chapters: FormChapter[]; }
ficmas?: number | null;
challenge?: number | null; export interface FormStory {
} title: string;
chapters: FormChapter[];
export const defaultChapter: FormChapter = { ficmas?: number | null;
chapterTitle: "", challenge?: number | null;
index: 1, completed: boolean;
summary: "", }
notes: "",
genre: [], export const defaultChapter: FormChapter = {
bands: [], chapterTitle: "",
characters: [], index: 1,
relationships: [], summary: "",
nsfw: false, notes: "",
loggedInOnly: true, genre: [],
hidden: false, bands: [],
content: "", characters: [],
fileName: "" relationships: [],
} nsfw: false,
loggedInOnly: true,
export const defaultStory: FormStory = { hidden: false,
title: "", content: "",
chapters: [], uuidKey: v4(),
ficmas: null, };
challenge: null,
} export const defaultStory: FormStory = {
title: "",
chapters: [],
ficmas: null,
challenge: null,
completed: false,
};