diff --git a/server/api/genres.get.ts b/server/api/genres.get.ts index dac184a..636aeff 100644 --- a/server/api/genres.get.ts +++ b/server/api/genres.get.ts @@ -1,7 +1,3 @@ -export default defineEventHandler((event) => { - return [ - 'Slash', - 'Het', - 'Gen' - ] -}) \ No newline at end of file +export default defineEventHandler((event) => { + return ["Slash", "Het", "Gen"]; +}); diff --git a/server/api/totals.get.ts b/server/api/totals.get.ts index f1b5584..8d3a5c2 100644 --- a/server/api/totals.get.ts +++ b/server/api/totals.get.ts @@ -1,10 +1,10 @@ -import mongoose from "mongoose"; -import { Story } from "~/models/stories"; - -export default eventHandler(async (event) => { - let aa = mongoose.connection.db.collection("z_index_totAuthors"); - let totalStories = await Story.countDocuments({"chapters.hidden": false}); - let totalAuthors = await aa.countDocuments(); - - return {stories: totalStories, authors: totalAuthors} -}) \ No newline at end of file +import mongoose from "mongoose"; +import { Story } from "~/models/stories"; + +export default eventHandler(async (event) => { + let aa = mongoose.connection.db.collection("z_index_totAuthors"); + let totalStories = await Story.countDocuments({ "chapters.hidden": false }); + let totalAuthors = await aa.countDocuments(); + + return { stories: totalStories, authors: totalAuthors }; +}); diff --git a/server/middleware/10.ficmasData.ts b/server/middleware/10.ficmasData.ts index 55ec07c..51f52bf 100644 --- a/server/middleware/10.ficmasData.ts +++ b/server/middleware/10.ficmasData.ts @@ -1,22 +1,25 @@ -import { Ficmas } from "~/models/challenges/ficmas"; - -export default eventHandler(async (event) => { - let y = new Date().getFullYear() - let fmfilt: any = {}; - - if (!!process.env.JulyFicmas && new Date() < new Date(Date.parse('Aug 1 ' + y))) { - fmfilt.isAnniversary = true; - fmfilt.year = y; - } else if (new Date() < new Date(Date.parse('Dec 25 ' + y))) { - fmfilt.year = process.env.YEAR; - fmfilt.isAnniversary = false; - } else { - fmfilt.keythatdoesntexist = { - $exists: true - } - } - let ficmasarray_raw = await Ficmas.find(fmfilt) - // console.log(ficsHidden()); - // console.log(query); - event.context.ficmasarray_raw = ficmasarray_raw -}) \ No newline at end of file +import { Ficmas } from "~/models/challenges/ficmas"; + +export default eventHandler(async (event) => { + let y = new Date().getFullYear(); + let fmfilt: any = {}; + + if ( + !!process.env.JulyFicmas && + new Date() < new Date(Date.parse("Aug 1 " + y)) + ) { + fmfilt.isAnniversary = true; + fmfilt.year = y; + } else if (new Date() < new Date(Date.parse("Dec 25 " + y))) { + fmfilt.year = process.env.YEAR; + fmfilt.isAnniversary = false; + } else { + fmfilt.keythatdoesntexist = { + $exists: true, + }; + } + let ficmasarray_raw = await Ficmas.find(fmfilt); + // console.log(ficsHidden()); + // console.log(query); + event.context.ficmasarray_raw = ficmasarray_raw; +});