Socket
Socket
Sign inDemoInstall

dispatch-node-sdk

Package Overview
Dependencies
Maintainers
3
Versions
148
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dispatch-node-sdk - npm Package Compare versions

Comparing version 1.8.1 to 1.8.2

17

dist/lib/bookingService.js

@@ -22,3 +22,5 @@ 'use strict';

var accountId = offerData.accountId,
data = offerData.data;
data = offerData.data,
_offerData$suggestedT = offerData.suggestedTimes,
suggestedTimes = _offerData$suggestedT === undefined ? {} : _offerData$suggestedT;

@@ -29,5 +31,16 @@ var headers = _extends({}, options.headers, {

options.headers = headers;
return client.doAuthenticatedRequest('POST', endpoints.BOOKING, data, options);
return client.doAuthenticatedRequest('POST', endpoints.BOOKING, data, options).then(function (response) {
// If suggested times, fire the seperate call to add them to the job offer
if (suggestedTimes.suggested_times.length > 0) {
var id = response.job_offer.id;
suggestedTimes.job_offer_id = id;
client.doAuthenticatedRequest('POST', endpoints.APPOINTMENTS + '/next/suggested_times', suggestedTimes, options); // eslint-disable-line prefer-template
}
return response.job_offer;
});
}
};
}

@@ -6,3 +6,3 @@ import * as endpoints from './endpoints';

bookNewOffer: (offerData, options = {}) => {
const { accountId, data } = offerData;
const { accountId, data, suggestedTimes = {} } = offerData;
const headers = {

@@ -13,5 +13,15 @@ ...options.headers,

options.headers = headers;
return client.doAuthenticatedRequest('POST', endpoints.BOOKING, data, options);
return client.doAuthenticatedRequest('POST', endpoints.BOOKING, data, options).then((response) => {
// If suggested times, fire the seperate call to add them to the job offer
if (suggestedTimes.suggested_times.length > 0) {
const { id } = response.job_offer;
suggestedTimes.job_offer_id = id;
client.doAuthenticatedRequest('POST', endpoints.APPOINTMENTS + '/next/suggested_times', suggestedTimes, options); // eslint-disable-line prefer-template
}
return response.job_offer;
});
},
};
}

2

package.json
{
"name": "dispatch-node-sdk",
"version": "1.8.1",
"version": "1.8.2",
"description": "High- and low-level libraries for interacting with the Dispatch API",

@@ -5,0 +5,0 @@ "main": "dist/lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc