From 9da3faab1fd0d30855d1786079e6601d8fb9b926 Mon Sep 17 00:00:00 2001 From: Brandon Norsworthy Date: Fri, 20 Sep 2024 01:01:55 -0500 Subject: [PATCH] allow saving filters --- constants/categories.ts | 24 +++++++++++++----------- models/category.ts | 22 ++++++++++++---------- validationSchemas/userSchema.ts | 4 +--- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/constants/categories.ts b/constants/categories.ts index 9a3f488..4f84ed0 100644 --- a/constants/categories.ts +++ b/constants/categories.ts @@ -1,16 +1,18 @@ import { categoryName } from "../models/category"; -const CATEGORIES: categoryName[] =[ - 'Monuments', - 'PVE', - 'Gambling', - 'PVP', - 'Roleplay', - 'Automation', - 'Troll', - 'Exploration', - 'Survival', - 'Raid' +const CATEGORIES: categoryName[] = [ + "PVP", + "PVE", + "Monuments", + "Exploration", + "Crafting", + "Gambling", + "Roleplay", + "Automation", + "Trolling", + "Survival", + "Raiding", + "Building" ] export default CATEGORIES; \ No newline at end of file diff --git a/models/category.ts b/models/category.ts index 666f9ce..2e2a0e9 100644 --- a/models/category.ts +++ b/models/category.ts @@ -7,15 +7,17 @@ type Category = { deleted_by: Date | null; }; -export type categoryName = 'Monuments' | - 'PVE' | - 'Gambling' | - 'PVP' | - 'Roleplay' | - 'Automation' | - 'Troll' | - 'Exploration' | - 'Survival' | - 'Raid'; +export type categoryName = "PVP" | + "PVE" | + "Monuments" | + "Exploration" | + "Crafting" | + "Gambling" | + "Roleplay" | + "Automation" | + "Trolling" | + "Survival" | + "Raiding" | + "Building"; export default Category; \ No newline at end of file diff --git a/validationSchemas/userSchema.ts b/validationSchemas/userSchema.ts index a26c135..b6d3939 100644 --- a/validationSchemas/userSchema.ts +++ b/validationSchemas/userSchema.ts @@ -23,8 +23,6 @@ export default { voicePropsDLCQuests: Joi.boolean(), sunburnDLCQuests: Joi.boolean(), categoryFilters: Joi.array() - .items( - Joi.string().valid(...CATEGORIES) - ), + .items(Joi.number()), }).unknown(false), } \ No newline at end of file