feathers-shippo
Version:
A Feathers JS adapter for the Shippo API
17 lines (16 loc) • 738 B
JavaScript
import { ShippoService, shippoLimiters, axiosOpts } from '../service';
export class ShippoServiceGroups extends ShippoService {
constructor(options, app) {
options = Object.assign(Object.assign({ limiters: shippoLimiters(options.token) }, options), { path: 'service-groups', methods: ['find', 'create', 'update', 'patch', 'remove'] });
super(options, app);
}
_update(id, data, params) {
return this.schedule('update', () => {
data = Object.assign(Object.assign({}, data), { object_id: id });
return this.shippo
.put('service-groups', data, axiosOpts(params))
.then(this.handleResult)
.catch(this.handleError);
});
}
}