Skip to content

Instantly share code, notes, and snippets.

@diego3g
Created July 3, 2018 02:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diego3g/5c4c4e13e037cb81bc5512bfff1e8a10 to your computer and use it in GitHub Desktop.
Save diego3g/5c4c4e13e037cb81bc5512bfff1e8a10 to your computer and use it in GitHub Desktop.
async destroy ({ params, auth, response }) {
const property = await Property.findOrFail(params.id)
if (property.user_id !== auth.user.id) {
return response.status(401).send({ error: 'Not authorized' })
}
await property.delete()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment