2019-03-12 14:04:09 +00:00
|
|
|
|
|
|
|
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
|
|
|
|
|
|
|
|
module.exports = Self => {
|
|
|
|
Self.remoteMethod('nodeDelete', {
|
|
|
|
description: 'Returns the first shipped and landed possible for params',
|
2019-05-22 10:35:24 +00:00
|
|
|
accessType: 'WRITE',
|
2019-03-12 14:04:09 +00:00
|
|
|
accepts: [{
|
|
|
|
arg: 'parentFk',
|
|
|
|
type: 'Number',
|
|
|
|
required: false,
|
|
|
|
}],
|
|
|
|
returns: {
|
|
|
|
type: ['object'],
|
|
|
|
root: true
|
|
|
|
},
|
|
|
|
http: {
|
|
|
|
path: `/nodeDelete`,
|
|
|
|
verb: 'POST'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
Self.nodeDelete = async parentFk => {
|
|
|
|
let stmt = new ParameterizedSQL(
|
|
|
|
`CALL nst.nodeDelete('vn', 'department', ?)`, [parentFk]);
|
|
|
|
|
|
|
|
return await Self.rawStmt(stmt);
|
|
|
|
};
|
|
|
|
};
|