reinitializing codebase and resuming development
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
getLocationByQuery,
|
||||
getLocationByRadius,
|
||||
} from "../models/Location/operations";
|
||||
import { createVisit } from "../models/Visit/operations";
|
||||
import { aggregateAssignment } from "../models/Assignment/operations";
|
||||
import { ObjectId } from "mongodb";
|
||||
|
||||
@@ -93,13 +94,14 @@ export const createLocationController = async (req, res) => {
|
||||
};
|
||||
|
||||
if (location.event === "geofence") {
|
||||
const [assignment, partner, venue] =
|
||||
location?.geofence?.identifier?.split("-");
|
||||
const { assignment, partner, venue } = location?.geofence?.extras;
|
||||
const visit = await createVisit({ assignment, venue });
|
||||
const geofencePayload = {
|
||||
assignment,
|
||||
partner,
|
||||
venue,
|
||||
action: location?.geofence?.action,
|
||||
visit: visit?._id,
|
||||
};
|
||||
|
||||
dbPayload.geofence = geofencePayload;
|
||||
|
||||
Reference in New Issue
Block a user