30 lines
745 B
JavaScript
30 lines
745 B
JavaScript
|
|
||
|
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
|
||
|
|
||
|
module.exports = Self => {
|
||
|
Self.remoteMethod('nodeDelete', {
|
||
|
description: 'Returns the first shipped and landed possible for params',
|
||
|
accessType: '',
|
||
|
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);
|
||
|
};
|
||
|
};
|