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