dispatch-node-sdk
Advanced tools
Comparing version 1.7.0 to 1.7.1
@@ -21,2 +21,8 @@ 'use strict'; | ||
return client.doAuthenticatedRequest('PATCH', endpoints.APPOINTMENTS + '/' + id + '/notify', appointmentProperties, headerOptions); | ||
}, | ||
selectSuggestedTime: function selectSuggestedTime(appointmentProperties) { | ||
var uuid = appointmentProperties.uuid; | ||
return client.doAuthenticatedRequest('PATCH', endpoints.APPOINTMENTS + '/' + id + '/suggested_times/' + uuid); | ||
} | ||
@@ -23,0 +29,0 @@ }; |
@@ -10,3 +10,9 @@ import * as endpoints from '../endpoints'; | ||
}, | ||
selectSuggestedTime: (appointmentProperties) => { | ||
const { uuid } = appointmentProperties; | ||
return client | ||
.doAuthenticatedRequest('PATCH', `${endpoints.APPOINTMENTS}/${id}/suggested_times/${uuid}`); | ||
}, | ||
}); | ||
} |
@@ -27,2 +27,19 @@ import expect from 'expect'; | ||
}); | ||
describe('suggested times', () => { | ||
const client = new Dispatch(testClientID, testClientSecret); | ||
const dispatchUrl = 'https://api.dispatch.me'; | ||
const properties = { uuid: 12345 }; | ||
it('should make a PATCH request with appointment ID and selected UUID', () => { | ||
const scope = nock(dispatchUrl) | ||
.patch(`${endpoints.APPOINTMENTS}/5555/suggested_times/12345`) | ||
.reply(200); | ||
client.setBearerToken(testBearerToken, testRefreshToken); | ||
client.entities.appointment(5555).selectSuggestedTime(properties); | ||
expect(scope.isDone()).toEqual(true); | ||
}); | ||
}); | ||
}); |
{ | ||
"name": "dispatch-node-sdk", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"description": "High- and low-level libraries for interacting with the Dispatch API", | ||
@@ -5,0 +5,0 @@ "main": "dist/lib/index.js", |
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
268150
6733