Skip to content

Commit

Permalink
Revert error text
Browse files Browse the repository at this point in the history
  • Loading branch information
DaddyWarbucks committed Jul 27, 2023
1 parent f82d0cc commit 3c809c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/rest-client/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ export abstract class Base<T = any, D = Partial<T>, P extends Params = RestClien

_update(id: NullableId, data: D, params?: P) {
if (typeof id === 'undefined') {
return Promise.reject(new Error("id for 'update' can not be undefined"))
return Promise.reject(
new Error("id for 'update' can not be undefined, only 'null' when updating multiple entries")
)
}

return this.request(
Expand Down
2 changes: 1 addition & 1 deletion packages/rest-client/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('REST client tests', function () {
})

await assert.rejects(() => service.update(undefined, {}), {
message: "id for 'update' can not be undefined"
message: "id for 'update' can not be undefined, only 'null' when updating multiple entries"
})

await assert.rejects(() => service.patch(undefined, {}), {
Expand Down

0 comments on commit 3c809c8

Please sign in to comment.