I have the following function:
Future<void> addLoyalty(int points) async {
print('inside add loyalty');
final url =
'https://fnj11223.firebaseio.com/loyalty/$userId.json?auth=$authToken';
try {
await http.post(
url,
body: json.encode({
'points': points,
}),
);
} catch (error) {
print(error);
throw error;
}
}
Here's the database snapshot:
I want to get rid of the extra ID generated. How can I tweak my function to achieve this?