Created
June 6, 2018 14:44
-
-
Save Charpell/0b97654b8a0aea79a9658e4e399f3525 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
exports.delete = functions.https.onRequest((req, res) => { | |
return cors(req, res, () => { | |
if(req.method !== 'DELETE') { | |
return res.status(401).json({ | |
message: 'Not allowed' | |
}) | |
} | |
const id = req.query.id | |
admin.database().ref(`/items/${id}`).remove() | |
getItemsFromDatabase(res) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment