Improve data validation for channel names
This commit is contained in:
parent
adf3cdf771
commit
29e7e2a297
5 changed files with 19 additions and 5 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { database } from "$/main";
|
||||
import { channelSchema } from "$/schemas/general";
|
||||
import { ServerRoute } from "@hapi/hapi";
|
||||
import { database } from "$/main";
|
||||
import Joi from "joi";
|
||||
|
||||
const route: ServerRoute = {
|
||||
|
|
@ -7,7 +8,7 @@ const route: ServerRoute = {
|
|||
options: {
|
||||
validate: {
|
||||
payload: Joi.object({
|
||||
channel: Joi.string().alphanum(),
|
||||
channel: channelSchema,
|
||||
}),
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue