2023-10-03 00:37:46 -04:00
|
|
|
import san from "sanitize-html";
|
2023-12-20 17:23:31 -05:00
|
|
|
import { FormChapter } from "@client/types/form/story";
|
|
|
|
import { IChapter } from "@models/stories/chapter";
|
2023-10-03 00:37:46 -04:00
|
|
|
import { sanitizeConf } from "../constants";
|
|
|
|
|
|
|
|
export default function (c: FormChapter): IChapter {
|
|
|
|
let t: IChapter = {
|
|
|
|
title: c.chapterTitle,
|
|
|
|
summary: san(c.summary, sanitizeConf),
|
|
|
|
notes: san(c.notes, sanitizeConf),
|
|
|
|
bands: c.bands,
|
|
|
|
characters: c.characters,
|
|
|
|
relationships: c.relationships,
|
|
|
|
nsfw: c.nsfw,
|
|
|
|
genre: c.genre,
|
|
|
|
loggedInOnly: c.loggedInOnly,
|
|
|
|
hidden: c.hidden,
|
|
|
|
};
|
|
|
|
return t;
|
|
|
|
}
|