feat: added marker functionality

This commit is contained in:
Rushil Umaretiya 2021-04-11 12:45:39 -04:00
parent afc7f05e78
commit 43a0317a3b
No known key found for this signature in database
GPG Key ID: 4E8FAF9C926AF959
2 changed files with 8 additions and 0 deletions

View File

@ -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()

View File

@ -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<Pool> = model('Address', AddressSchema);