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:
parent
9e649118e5
commit
40bde7c08b
@ -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()
|
||||||
|
@ -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',
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user