adding Error Logger and enhancements to locationUpdate Controller
This commit is contained in:
@@ -11,12 +11,13 @@ export const createLocationController = async (req, res) => {
|
||||
const dbPayload = {
|
||||
battery: location.battery.level,
|
||||
coordinatess: location.coords,
|
||||
recorded_at: location.recorded_at,
|
||||
createdOn: location.recorded_at,
|
||||
};
|
||||
const uploaded = await createLocation({ ...dbPayload, user: user?.id });
|
||||
console.log("BG LOCATION DB DOC", uploaded, user);
|
||||
res.status(200).json({ result: uploaded });
|
||||
} catch (error) {
|
||||
console.log("createLocationController Error", error);
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user