Good afternoon community Developers .... difficulty recording using firebase ...
The firebase cloud functions console gives this error message:
decode64(userTo) ********@gmail.com
decode64(userFrom) YWRyaWVsQHVuaXBsYWNsYWdlcy5lZHUuYnI=
Uncaught exception
ReferenceError: ut is not defined
My code looks like this:
let ut = decode64(userTo)
let uf = encode64(userFrom)
console.log('decode64(userTo)', ut)
console.log('encode64(userFrom)', uf)
db.collection('users').doc(ut).collection('contacts').doc(uf).set({
lastMessage: messageDoc.content,
lastMessageTime: new Date()
}, {
merge: true
}).then(() => {
console.log('[END]');
resolve(true);
return true;
}).catch(e => {
throw new Error("User last message not saved.");
});
Thank you in advance ...