1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-06-04 01:18:20 +02:00

fix: projectId must follow nameType in query

This commit is contained in:
Ivar Conradi Østhus 2021-03-05 14:12:56 +01:00
parent 9e649118e5
commit 40bde7c08b
No known key found for this signature in database
GPG Key ID: 31AC596886B0BD09
2 changed files with 2 additions and 5 deletions

View File

@ -100,7 +100,7 @@ const querySchema = joi
project: joi project: joi
.array() .array()
.allow(null) .allow(null)
.items(joi.string().alphanum()) .items(nameType)
.optional(), .optional(),
namePrefix: joi namePrefix: joi
.string() .string()

View File

@ -262,8 +262,5 @@ test('Filter queries should reject project names that are not alphanum', t => {
project: ['project name with space'], project: ['project name with space'],
}; };
const { error } = querySchema.validate(query); const { error } = querySchema.validate(query);
t.deepEqual( t.deepEqual(error.details[0].message, '"project[0]" must be URL friendly');
error.details[0].message,
'"project[0]" must only contain alpha-numeric characters',
);
}); });