|
@@ -30,7 +30,12 @@ export const upsertAiAssistantValidator: ValidationChain[] = [
|
|
|
.withMessage('pagePathPatterns must be an array of strings')
|
|
.withMessage('pagePathPatterns must be an array of strings')
|
|
|
.not()
|
|
.not()
|
|
|
.isEmpty()
|
|
.isEmpty()
|
|
|
- .withMessage('pagePathPatterns must not be empty'),
|
|
|
|
|
|
|
+ .withMessage('pagePathPatterns must not be empty')
|
|
|
|
|
+ .custom((pagePathPattens: string[]) => {
|
|
|
|
|
+ if (pagePathPattens.length > 300) {
|
|
|
|
|
+ throw new Error('pagePathPattens must be an array of strings with a maximum length of 300');
|
|
|
|
|
+ }
|
|
|
|
|
+ }),
|
|
|
|
|
|
|
|
body('pagePathPatterns.*') // each item of pagePathPatterns
|
|
body('pagePathPatterns.*') // each item of pagePathPatterns
|
|
|
.isString()
|
|
.isString()
|