#15 WIP fixed requested changes
gitea/salix/1625-worker_department_treeview This commit looks good Details

This commit is contained in:
Joan Sanchez 2019-10-08 12:48:12 +02:00
parent 770a60546a
commit 4025c624b3
4 changed files with 7 additions and 7 deletions

View File

@ -108,5 +108,5 @@
"This postal code is not valid": "This postal code is not valid",
"is invalid": "is invalid",
"The postcode doesn't exists. Ensure you put the correct format": "El código postal no existe. Asegúrate de ponerlo con el formato correcto",
"The department name can't be repeated": "The department name can't be repeated"
"The department name can't be repeated": "El nombre del departamento no puede repetirse"
}

View File

@ -2,7 +2,7 @@ module.exports = Self => {
Self.remoteMethod('getLeaves', {
description: 'Returns the nodes for a department',
accepts: [{
arg: 'parentFk',
arg: 'parentId',
type: 'Number',
description: 'Get the children of the specified father',
}, {
@ -20,10 +20,10 @@ module.exports = Self => {
}
});
Self.getLeaves = async(parentFk = null, search) => {
Self.getLeaves = async(parentId = null, search) => {
let [res] = await Self.rawSql(
`CALL department_getLeaves(?, ?)`,
[parentFk, search]
[parentId, search]
);
let map = new Map();
@ -41,7 +41,7 @@ module.exports = Self => {
}
}
let leaves = map.get(parentFk);
let leaves = map.get(parentId);
setLeaves(leaves);
return leaves || [];

View File

@ -1,6 +1,6 @@
module.exports = Self => {
Self.remoteMethod('removeChild', {
description: 'Returns the first shipped and landed possible for params',
description: 'Removes a child department',
accessType: 'WRITE',
accepts: [{
arg: 'id',

View File

@ -13,7 +13,7 @@ class Controller {
}
onFetch(item) {
const params = item ? {parentFk: item.id} : null;
const params = item ? {parentId: item.id} : null;
return this.$.model.applyFilter({}, params).then(() => {
return this.$.model.data;
});