Created the meta.ts validation
This commit is contained in:
parent
c4d6d5b92b
commit
3b91c8cb40
17
src/routes/v1/validations/meta.ts
Normal file
17
src/routes/v1/validations/meta.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import Joi from "joi";
|
||||||
|
import { ILicenseMetaType } from "@models/MetaData";
|
||||||
|
|
||||||
|
export const createMetaValidation = Joi.object({
|
||||||
|
type: Joi.string().valid(ILicenseMetaType.TEXT, ILicenseMetaType.NUMBER, ILicenseMetaType.BOOLEAN).required(),
|
||||||
|
name: Joi.string().alphanum().max(50).required(),
|
||||||
|
description: Joi.string().min(3).max(100).required(),
|
||||||
|
defaultValue: Joi.string().max(50),
|
||||||
|
public: Joi.boolean().default(false)
|
||||||
|
});
|
||||||
|
|
||||||
|
export const updateMetaValidation = Joi.object({
|
||||||
|
name: Joi.string().alphanum().max(50),
|
||||||
|
description: Joi.string().min(3).max(100),
|
||||||
|
defaultValue: Joi.string().max(50),
|
||||||
|
public: Joi.boolean().default(false)
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user