@simpleview/crm-client
Advanced tools
Comparing version 1.0.5 to 1.0.6
{ | ||
"name" : "@simpleview/crm-client", | ||
"version" : "1.0.5", | ||
"version" : "1.0.6", | ||
"description" : "Client for communicating with sv-crm", | ||
@@ -5,0 +5,0 @@ "author" : "Sean Albert <smabert@gmail.com>", |
@@ -193,2 +193,26 @@ const { query } = require("@simpleview/sv-graphql-client"); | ||
async delete_v2({ recType, refType, recId, context }) { | ||
context = context || this._graphServer.context; | ||
const variables = { | ||
recId, | ||
type: refType, | ||
acct_id: context.acct_id | ||
}; | ||
const queryStr = `mutation($acct_id: String!, $recId: Int!${refType ? ", $type: String!" : ""}) { | ||
crm(acct_id: $acct_id) { | ||
delete_${recType} ( | ||
recId: $recId | ||
${refType ? `type: $type` : ""} | ||
) | ||
} | ||
}`; | ||
const response = await query({ | ||
query: queryStr, | ||
variables, | ||
url: this._graphUrl, | ||
token: context.token | ||
}); | ||
return response.crm[`delete_${recType}`]; | ||
} | ||
/** | ||
@@ -195,0 +219,0 @@ * TODO: This is not implemented yet on graph side, the way to handle delete check is TBD |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11367
284