Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mguellsegarra committed May 16, 2024
2 parents 5c44ce3 + 9e67ff9 commit c89d380
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export class Model {
}

public async delete(options: ModelDeleteOpts): Promise<any> {
const { ids } = options;
const { ids, context } = options;
const { model } = this;
const { database, token } = this.client;

Expand All @@ -215,6 +215,7 @@ export class Model {
token: token!,
model,
ids,
context
});

return await this.client._fetch({
Expand Down
4 changes: 2 additions & 2 deletions lib/payloads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ export const createCreatePayload = (options: ModelCreatePayload): Payload => {
};

export const createDeletePayload = (options: ModelDeletePayload): Payload => {
const { database, token, model, ids } = options;
return ["execute", database, "token", token, model, "unlink", ids];
const { database, token, model, ids, context } = options;
return ["execute", database, "token", token, model, "unlink", ids, context];
};

export const createFieldsViewGetPayload = (
Expand Down
1 change: 1 addition & 0 deletions lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export type ModelCreateOpts = {

export type ModelDeleteOpts = {
ids: Array<number>;
context?: Context;
};

export type ModelReadPayload = Model & Database & Token & ModelReadOpts;
Expand Down
4 changes: 2 additions & 2 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gisce/powerp.js",
"version": "1.2.1",
"version": "1.2.2",
"description": "PowERP Javascript Client",
"main": "dist/index.js",
"module": "dist/index.esm.js",
Expand Down

0 comments on commit c89d380

Please sign in to comment.