Skip to content

Commit

Permalink
chore: utilizes combineQueries in getEntityPolicies function
Browse files Browse the repository at this point in the history
  • Loading branch information
JarrodMFlesch committed Oct 16, 2024
1 parent c63b7bc commit c30830f
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions packages/payload/src/utilities/getEntityPolicies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { Field, FieldAccess } from '../fields/config/types.js'
import type { SanitizedGlobalConfig } from '../globals/config/types.js'
import type { AllOperations, Document, PayloadRequest, Where } from '../types/index.js'

import { combineQueries } from '../database/combineQueries.js'
import { tabHasName } from '../fields/config/types.js'

type Args = {
Expand Down Expand Up @@ -63,17 +64,7 @@ export async function getEntityPolicies<T extends Args>(args: T): Promise<Return
overrideAccess: true,
pagination: false,
req,
where: {
...where,
and: [
...(where.and || []),
{
id: {
equals: id,
},
},
],
},
where: combineQueries(where, { id: { equals: id } }),
})

return paginatedRes?.docs?.[0] || undefined
Expand Down

0 comments on commit c30830f

Please sign in to comment.