From f48ac551f450dbffd51018580879baefb1f3479a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Tue, 3 Oct 2023 01:15:29 -0400 Subject: [PATCH] style(db/models): run prettier on `models/challenges` directory --- models/challenges/biffno.ts | 57 ++++++++++++++++++++----------------- models/challenges/ficmas.ts | 41 +++++++++++++++----------- models/challenges/gen.ts | 28 +++++++++--------- 3 files changed, 71 insertions(+), 55 deletions(-) diff --git a/models/challenges/biffno.ts b/models/challenges/biffno.ts index 4ccd7ef..fef1891 100644 --- a/models/challenges/biffno.ts +++ b/models/challenges/biffno.ts @@ -1,11 +1,10 @@ -import mongoose, {Schema, PopulatedDoc, Document, Model} from "mongoose"; -import { IUser } from "../../models/user"; +import mongoose, { Schema, PopulatedDoc, Document, Model } from "mongoose"; +import { IUser } from "~/models/user"; import SequenceFactory from "mongoose-sequence"; -import { hasMigrated } from "../../lib/dbconfig"; +import { hasMigrated } from "~/lib/dbconfig"; const AutoIncrement = SequenceFactory(mongoose); - export interface IBiffno { _id: number; title: string; @@ -13,56 +12,62 @@ export interface IBiffno { excerpt: string; bands: number[]; tags: string[]; - wordcount: number; + words: number; genre: string; cover: string; year: number; - author: PopulatedDoc + author: PopulatedDoc; } const biffnoschema = new mongoose.Schema({ _id: { - type: Number + type: Number, }, title: { type: String, - default: "" + default: "", }, description: { type: String, - default: "" + default: "", }, excerpt: { type: String, - default: "" + default: "", }, - bands: [{ + bands: [ + { + type: Number, + ref: "Band", + }, + ], + tags: [ + { + type: String, + }, + ], + words: { type: Number, - ref: "Band" - }], - tags: [{ - type: String - }], - wordcount: { - type: Number, - default: 0 + default: 0, }, genre: { - type: String + type: String, }, cover: { type: String, - default: "" + default: "", }, year: { type: Number, - default: 0 + default: 0, }, author: { type: Number, - ref: "User" - } + ref: "User", + }, }); -hasMigrated && biffnoschema.plugin(AutoIncrement, {start_seq: 1, id: "bif_id"}); -export const Biffno: Model = /* mongoose.models.Biffno || */ mongoose.model('Biffno', biffnoschema, 'biffno'); +hasMigrated && + biffnoschema.plugin(AutoIncrement, { start_seq: 1, id: "bif_id" }); +export const Biffno: Model = + mongoose.models.Biffno || mongoose.model("Biffno", biffnoschema, "biffno"); diff --git a/models/challenges/ficmas.ts b/models/challenges/ficmas.ts index 61c93fa..79f6271 100644 --- a/models/challenges/ficmas.ts +++ b/models/challenges/ficmas.ts @@ -1,9 +1,15 @@ -import mongoose, {Schema, PopulatedDoc, Document, Model, model} from "mongoose"; +import mongoose, { + Schema, + PopulatedDoc, + Document, + Model, + model, +} from "mongoose"; -import { IBand } from "../../models/band"; -import { IUser } from "../../models/user"; +import { IBand } from "~/models/band"; +import { IUser } from "~/models/user"; import SequenceFactory from "mongoose-sequence"; -import { hasMigrated } from "../../lib/dbconfig"; +import { hasMigrated } from "~/lib/dbconfig"; const AutoIncrement = SequenceFactory(mongoose); @@ -19,27 +25,30 @@ export interface IFicmas { export const FicmasSchema = new mongoose.Schema({ _id: { - type: Number + type: Number, }, kink: { - type: String + type: String, }, year: { type: String }, - bands: [{ - type: Number, - ref: "Band" - }], + bands: [ + { + type: Number, + ref: "Band", + }, + ], relationship: { type: String }, wisher: { type: Number, - ref: "User" + ref: "User", }, anniversary: { type: Boolean, - default: false - } -}) + default: false, + }, +}); -hasMigrated && FicmasSchema.plugin(AutoIncrement, {id: "ficmas_wishes"}) +hasMigrated && FicmasSchema.plugin(AutoIncrement, { id: "ficmas_wishes" }); -export const Ficmas: Model = /* mongoose.models.Ficmas || */ model("Ficmas", FicmasSchema, "ficmas_wishes") +export const Ficmas: Model = + mongoose.models.Ficmas || model("Ficmas", FicmasSchema, "ficmas_wishes"); diff --git a/models/challenges/gen.ts b/models/challenges/gen.ts index f77d725..3344631 100644 --- a/models/challenges/gen.ts +++ b/models/challenges/gen.ts @@ -1,6 +1,6 @@ -import mongoose, {Schema, PopulatedDoc, Document, Model} from "mongoose"; +import mongoose, { Schema, PopulatedDoc, Document, Model } from "mongoose"; import SequenceFactory from "mongoose-sequence"; -import { hasMigrated } from "../../lib/dbconfig"; +import { hasMigrated } from "~/lib/dbconfig"; const AutoIncrement = SequenceFactory(mongoose); @@ -16,34 +16,36 @@ export interface IChallenge { const challengeSchema = new mongoose.Schema({ _id: { - type: Number + type: Number, }, name: { type: String, - required: true + required: true, }, description: { type: String, - required: true + required: true, }, deadline: { type: Date, - required: true + required: true, }, active: { type: Boolean, - default: true + default: true, }, color: { type: String, required: true, - default: `#${Math.floor(Math.random()*16777215).toString(16)}` + default: `#${Math.floor(Math.random() * 16777215).toString(16)}`, }, allowMultiple: { type: Boolean, - default: true - } -}) + default: true, + }, +}); -hasMigrated && challengeSchema.plugin(AutoIncrement, {id: "challenges"}); -export const Challenge: Model = /* mongoose.models.Challenge || */ mongoose.model("Challenge", challengeSchema, "challenges") +hasMigrated && challengeSchema.plugin(AutoIncrement, { id: "challenges" }); +export const Challenge: Model = + mongoose.models.Challenge || + mongoose.model("Challenge", challengeSchema, "challenges");