Created
July 3, 2018 02:15
-
-
Save diego3g/5c4c4e13e037cb81bc5512bfff1e8a10 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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