Skip to content

Commit

Permalink
DEV: add params.noerror
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael O'Brien committed Jul 6, 2024
1 parent 78df5a8 commit 67aa49b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Model.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ export type OneParams = {
many?: boolean
maxPages?: number
next?: object
noerror?: boolean
parse?: boolean
partial?: boolean
postFormat?: (model: AnyModel, cmd: {}) => {}
Expand Down
2 changes: 1 addition & 1 deletion src/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@ export class Model {
does not have all the properties and required fields may be missing).
Also find operation with fields selections may not include required fields.
*/
if (!params.transaction && !params.fields) {
if (!params.transaction && !params.fields && !field.encode && !params.noerror) {
this.table.log.error(`Required field "${name}" in model "${this.name}" not defined in table item`, {
model: this.name, raw, params, field,
})
Expand Down

0 comments on commit 67aa49b

Please sign in to comment.