payload icon indicating copy to clipboard operation
payload copied to clipboard

fix(db-postgres): allow to clear select fields with `hasMany: true`

Open r1tsuu opened this issue 3 months ago • 0 comments

What?

Previously, using Postgres, select fields with hasMany: true weren't clearable. Meaning, you couldn't pass an empty array:

const updatedDoc = await payload.update({
  id,
  collection: 'select-fields',
  data: {
    selectHasMany: [],
  },
})

Why?

To achieve the same behavior with MongoDB.

How?

Modifies logic in packages/drizzle/src/upsertRow/index.ts to include empty arrays.

r1tsuu avatar Nov 23 '24 08:11 r1tsuu