From e75a2cc38c85faf579e13d22424613847be8783d Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sun, 22 Jan 2023 18:04:12 +0100 Subject: [PATCH] Created the key.ts validation --- src/routes/v1/validations/key.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/routes/v1/validations/key.ts diff --git a/src/routes/v1/validations/key.ts b/src/routes/v1/validations/key.ts new file mode 100644 index 0000000..d567223 --- /dev/null +++ b/src/routes/v1/validations/key.ts @@ -0,0 +1,7 @@ +import Joi from "joi"; +import { IKeyRole } from "@models/AccessKey"; + +export const keyCreationValidation = Joi.object({ + name: Joi.string().min(2).max(15).required(), + role: Joi.number().valid(IKeyRole) +}); \ No newline at end of file