From 43a0317a3b00096a912ad55566c357dd98724bc7 Mon Sep 17 00:00:00 2001 From: Rushil Umaretiya Date: Sun, 11 Apr 2021 12:45:39 -0400 Subject: [PATCH] feat: added marker functionality --- src/api/address.ts | 4 ++++ src/models.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/api/address.ts b/src/api/address.ts index 234389b..42bf0f8 100644 --- a/src/api/address.ts +++ b/src/api/address.ts @@ -34,12 +34,16 @@ router.post('/', async (req, res) => { const userID = req.session.accountID; const poolID = req.body.pool; const location = req.body.location; + const lat = req.body.lat; + const lng = req.body.lng; const address = new AddressModel(); Object.assign(address, { user: userID, pool: poolID, location: location, + lat: lat, + lng: lng, }); address .save() diff --git a/src/models.ts b/src/models.ts index 0162731..b12801c 100644 --- a/src/models.ts +++ b/src/models.ts @@ -83,12 +83,16 @@ export interface Address extends Document { user: string; pool: string; location: string; + lat: string; + lng: string; } const AddressSchema: Schema = new Schema({ user: { type: String, required: true }, pool: { type: String, required: true }, location: { type: String, required: true }, + lat: { type: String, required: true }, + lng: { type: String, required: true }, }); const AddressModel: Model = model('Address', AddressSchema);