fix(db-postgres): query with like on id columns (#6416)
copy of https://github.com/payloadcms/payload/pull/6414 to main
This commit is contained in:
@@ -513,6 +513,26 @@ describe('collections-rest', () => {
|
||||
expect(result.docs).toEqual([post])
|
||||
expect(result.totalDocs).toEqual(1)
|
||||
})
|
||||
|
||||
it('should query LIKE by ID', async () => {
|
||||
const post = await payload.create({
|
||||
collection: slug,
|
||||
data: {
|
||||
title: 'find me buddy',
|
||||
},
|
||||
})
|
||||
|
||||
const { result, status } = await client.find<Post>({
|
||||
query: {
|
||||
id: {
|
||||
like: post.id,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
expect(status).toStrictEqual(200)
|
||||
expect(result.totalDocs).toStrictEqual(1)
|
||||
})
|
||||
})
|
||||
|
||||
it('should query nested relationship - hasMany', async () => {
|
||||
|
||||
Reference in New Issue
Block a user