Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exports.deleteUser = functions.https.onCall((data, context) => {
- var users = data.users;
- var promises = [];
- users.forEach(function(user) {
- return admin.auth().deleteUser(user).then(() => {
- return promise.push(admin.firestore().collection('users').doc(user))
- })
- console.log(user)
- });
- return Promise.all(promises).then(() => {
- return {
- messagge: 'Usuarios eliminados con exito!'
- }
- }).catch(error => {
- return {
- message: 'error:' + error
- }
- });
- })
Advertisement
Add Comment
Please, Sign In to add comment