update profiles
This commit is contained in:
@@ -114,6 +114,18 @@ DB.getDB.then((DB)=>{
|
||||
});
|
||||
});
|
||||
|
||||
router.post("/myProfile", async (req, res) => {
|
||||
let profile = {
|
||||
userid: getUserId(req),
|
||||
profile: req.body
|
||||
};
|
||||
let profileObj = new Profile(profile); //validates profile
|
||||
DB.updateProfile(getProfileId(req), profileObj);
|
||||
return res.json({
|
||||
status: "ok"
|
||||
});
|
||||
});
|
||||
|
||||
router.get("/:id", async (req, res) => {
|
||||
let profileId = req.params.id;
|
||||
let profile = await DB.getProfile(profileId);
|
||||
|
||||
Reference in New Issue
Block a user