keyvalue storage using data in the profile

This commit is contained in:
Adolfo Reyna
2021-09-13 18:40:08 -07:00
parent 8797e5e984
commit f92aa70621
2 changed files with 28 additions and 0 deletions

View File

@@ -104,6 +104,16 @@ DB.getDB.then((DB)=>{
});
});
router.post("/setData", (req, res) => {
const key = req.body.key;
const value = req.body.value;
const profileid = getProfileId(req);
DB.setData(profileid, key, value);
return res.json({
status: "ok",
});
});
router.get("/:id", async (req, res) => {
let profileId = req.params.id;
let profile = await DB.getProfile(profileId);