iOS client calls function with the following params:
func buyTicket(contestId: String, points: Int) -> SignalProducer<Void, Error> {
Functions.functions().httpsCallable("myFunction").call([
"userId": Auth.auth().currentUser!.uid,
"points": points,
"contestId": contestId
], completion: ...
Then at the beginning of the function I have this log
const userId = req.body.data.userId;
const contestId = req.body.data.contestId;
const points = req.body.data.points;
console.log(`myFunction called with userId: ${userId} contestId: ${contestId} points: ${points}`);
What gets printed is
myFunction called with userId: BzoW5pWLbWRnd2UgjnTkfd3xfNf2 contestId: pBsQo0FHMyu4ay18dexy points: [object Object]
why is points converted to an object?
This is causing my function to crash when I try to pass points to FieldValue.increment