usecase('Delete Item', {
// Input/Request metadata and validation
request: {
id: Number
},
// Output/Response metadata
response: Boolean,
//Authorization with Audit
// authorize: user => (user.canDeleteItem ? Ok() : Err()),
authorize: user => Ok(user),
'Update the Item': step(async ctx => {
await itemRepository.deleteByID(parseInt(ctx.req.id))
return Ok()
})
})
module.exports = useCase
'Delete the Item': step(async ctx => {
current:
change to: