location updates saved to db and base endpoints for other modules started

This commit is contained in:
Shibi Chakkaravarthy
2026-04-18 04:15:23 +05:30
parent 92769cfd38
commit eb84767d44
12 changed files with 167 additions and 44 deletions
+7 -1
View File
@@ -7,8 +7,14 @@ import {
export const createLocationController = async (req, res) => {
try {
const { user } = res.locals;
const { location } = req.body;
console.log("BG LOCATIONREQUEST BODY", req.body, user);
// const location = await createLocation({ ...req.body, user: user?.id });
const dbPayload = {
battery: location.battery.level,
coordinatess: location.coords,
recorded_at: location.recorded_at,
};
const uploaded = await createLocation({ ...req.body, user: user?.id });
res.status(200).json({ location: "location" });
} catch (error) {
res.status(500).json({ error: error.message });