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:
Dan Ribbens
2024-05-17 14:07:57 -04:00
committed by GitHub
parent ab8b2f3fb8
commit bf77cec7e9
2 changed files with 28 additions and 1 deletions

View File

@@ -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 () => {