Fix endpoint to check invitations
This commit is contained in:
9
index.js
9
index.js
@@ -110,6 +110,15 @@ DB.getDB.then((DB) => {
|
||||
DB.setWebSubscription(profileid, subscription);
|
||||
});
|
||||
|
||||
app.get("/invite/:email", async (req, res) => {
|
||||
const email = req.params.email;
|
||||
//validate email?
|
||||
if(!email) return res.json({status: "provide valid email"});
|
||||
let r = await DB.getInvitation(email);
|
||||
if(!r) return res.json({status: "no invitation found with that email"});
|
||||
return res.json({status: "ok", ... r});
|
||||
});
|
||||
|
||||
// Function to Singup new users. An user is a combination of a user obj and a profile.
|
||||
// When new users are subscribed, they have a single profile, which is the personal one.
|
||||
// Other profiles can be link to that user, like groups or courses.
|
||||
|
||||
Reference in New Issue
Block a user