1781-zoneHoliday #994
|
@ -1,8 +1,8 @@
|
|||
const UserError = require('vn-loopback/util/user-error');
|
||||
|
||||
module.exports = Self => {
|
||||
Self.remoteMethod('editExclusionGeo', {
|
||||
description: 'Edit the geos excluded from a zone',
|
||||
Self.remoteMethod('updateExclusionGeo', {
|
||||
description: 'Update the geos excluded from a zone',
|
||||
accepts: [
|
||||
{
|
||||
arg: 'zoneExclusionFk',
|
||||
|
@ -21,12 +21,12 @@ module.exports = Self => {
|
|||
root: true
|
||||
},
|
||||
http: {
|
||||
path: `/editExclusionGeo`,
|
||||
path: `/updateExclusionGeo`,
|
||||
verb: 'POST'
|
||||
}
|
||||
});
|
||||
|
||||
Self.editExclusionGeo = async(zoneExclusionFk, geoIds, options) => {
|
||||
Self.updateExclusionGeo = async(zoneExclusionFk, geoIds, options) => {
|
||||
const models = Self.app.models;
|
||||
const myOptions = {};
|
||||
|
|
@ -9,7 +9,7 @@ module.exports = Self => {
|
|||
require('../methods/zone/includingExpired')(Self);
|
||||
require('../methods/zone/getZoneClosing')(Self);
|
||||
require('../methods/zone/exclusionGeo')(Self);
|
||||
require('../methods/zone/editExclusionGeo')(Self);
|
||||
require('../methods/zone/updateExclusionGeo')(Self);
|
||||
|
||||
Self.validatesPresenceOf('agencyModeFk', {
|
||||
message: `Agency cannot be blank`
|
||||
|
|
|
@ -229,7 +229,7 @@ class Controller extends Section {
|
|||
zoneExclusionFk: this.excludeSelected.id,
|
||||
geoIds
|
||||
};
|
||||
req = this.$http.post(`Zones/editExclusionGeo`, params);
|
||||
req = this.$http.post(`Zones/updateExclusionGeo`, params);
|
||||
}
|
||||
return req.then(() => this.refresh());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue