Created
May 16, 2018 10:38
-
-
Save Charpell/0cb0cffd3686e32843f9a9d6367e459e 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(500).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