refactor: change name of endpoint
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2022-07-08 09:47:11 +02:00
parent 94872f8493
commit eb586643ca
3 changed files with 6 additions and 6 deletions

View File

@ -1,8 +1,8 @@
const UserError = require('vn-loopback/util/user-error'); const UserError = require('vn-loopback/util/user-error');
module.exports = Self => { module.exports = Self => {
Self.remoteMethod('editExclusionGeo', { Self.remoteMethod('updateExclusionGeo', {
description: 'Edit the geos excluded from a zone', description: 'Update the geos excluded from a zone',
accepts: [ accepts: [
{ {
arg: 'zoneExclusionFk', arg: 'zoneExclusionFk',
@ -21,12 +21,12 @@ module.exports = Self => {
root: true root: true
}, },
http: { http: {
path: `/editExclusionGeo`, path: `/updateExclusionGeo`,
verb: 'POST' verb: 'POST'
} }
}); });
Self.editExclusionGeo = async(zoneExclusionFk, geoIds, options) => { Self.updateExclusionGeo = async(zoneExclusionFk, geoIds, options) => {
const models = Self.app.models; const models = Self.app.models;
const myOptions = {}; const myOptions = {};

View File

@ -9,7 +9,7 @@ module.exports = Self => {
require('../methods/zone/includingExpired')(Self); require('../methods/zone/includingExpired')(Self);
require('../methods/zone/getZoneClosing')(Self); require('../methods/zone/getZoneClosing')(Self);
require('../methods/zone/exclusionGeo')(Self); require('../methods/zone/exclusionGeo')(Self);
require('../methods/zone/editExclusionGeo')(Self); require('../methods/zone/updateExclusionGeo')(Self);
Self.validatesPresenceOf('agencyModeFk', { Self.validatesPresenceOf('agencyModeFk', {
message: `Agency cannot be blank` message: `Agency cannot be blank`

View File

@ -229,7 +229,7 @@ class Controller extends Section {
zoneExclusionFk: this.excludeSelected.id, zoneExclusionFk: this.excludeSelected.id,
geoIds geoIds
}; };
req = this.$http.post(`Zones/editExclusionGeo`, params); req = this.$http.post(`Zones/updateExclusionGeo`, params);
} }
return req.then(() => this.refresh()); return req.then(() => this.refresh());
} }