fix(drizzle): sanitize query value uuid / number id NaN (#8369)

Fixes https://github.com/payloadcms/payload/issues/8347 (additionally
for UUID search as well)
This commit is contained in:
Sasha
2024-09-23 18:35:07 +03:00
committed by GitHub
parent 338c93a229
commit dedcff0448
3 changed files with 30 additions and 0 deletions

View File

@@ -934,6 +934,22 @@ describe('collections-rest', () => {
expect(result.totalDocs).toEqual(1)
})
it('like - id should not crash', async () => {
const post = await createPost({ title: 'post' })
const response = await restClient.GET(`/${slug}`, {
query: {
where: {
id: {
like: 'words partial',
},
},
},
})
expect(response.status).toEqual(200)
})
it('exists - true', async () => {
const postWithDesc = await createPost({ description: 'exists' })
await createPost({ description: undefined })