mirror of
https://github.com/myfatemi04/wheelshare-old-backend.git
synced 2025-04-21 12:10:17 -04:00
feat: added marker functionality
This commit is contained in:
parent
afc7f05e78
commit
43a0317a3b
|
@ -34,12 +34,16 @@ router.post('/', async (req, res) => {
|
||||||
const userID = req.session.accountID;
|
const userID = req.session.accountID;
|
||||||
const poolID = req.body.pool;
|
const poolID = req.body.pool;
|
||||||
const location = req.body.location;
|
const location = req.body.location;
|
||||||
|
const lat = req.body.lat;
|
||||||
|
const lng = req.body.lng;
|
||||||
|
|
||||||
const address = new AddressModel();
|
const address = new AddressModel();
|
||||||
Object.assign(address, {
|
Object.assign(address, {
|
||||||
user: userID,
|
user: userID,
|
||||||
pool: poolID,
|
pool: poolID,
|
||||||
location: location,
|
location: location,
|
||||||
|
lat: lat,
|
||||||
|
lng: lng,
|
||||||
});
|
});
|
||||||
address
|
address
|
||||||
.save()
|
.save()
|
||||||
|
|
|
@ -83,12 +83,16 @@ export interface Address extends Document {
|
||||||
user: string;
|
user: string;
|
||||||
pool: string;
|
pool: string;
|
||||||
location: string;
|
location: string;
|
||||||
|
lat: string;
|
||||||
|
lng: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const AddressSchema: Schema = new Schema({
|
const AddressSchema: Schema = new Schema({
|
||||||
user: { type: String, required: true },
|
user: { type: String, required: true },
|
||||||
pool: { type: String, required: true },
|
pool: { type: String, required: true },
|
||||||
location: { 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);
|
const AddressModel: Model<Pool> = model('Address', AddressSchema);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user