salix/services/loopback/common/methods/ticket/deleted.js

26 lines
646 B
JavaScript

module.exports = Self => {
Self.remoteMethod('deleted', {
description: 'Sets the isDeleted value of a ticket to 1',
accessType: '',
accepts: [{
arg: 'ticketFk',
type: 'Object',
required: true,
description: 'TicketFk',
http: {source: 'body'}
}],
returns: {
type: 'string',
root: true
},
http: {
path: `/deleted`,
verb: 'post'
}
});
Self.deleted = async params => {
return await Self.app.models.Ticket.update({id: params.id}, {isDeleted: '1'});
};
};