@defra/wls-eps-api
Version:
The API to support the wildlife licencing of European Protected Species
19 lines (17 loc) • 440 B
JavaScript
import { cache } from '../../services/cache.js'
import { models } from '../../model/sequentelize-model.js'
export default async (context, req, h) => {
await cache.delete(req.path)
const count = await models.users.destroy({
where: {
id: context.request.params.userId
}
})
if (count === 1) {
// Return no content
return h.response().code(204)
} else {
// Not found
return h.response().code(404)
}
}