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:
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user