Merged in bug-fixing-8-sep-24_2 (pull request #100)
Bug fixing 8 sep 24 2 Approved-by: Tiago Ribeiro
This commit is contained in:
@@ -72,6 +72,9 @@ async function registerIndividual(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
...(passport_id ? {demographicInformation: {passport_id}} : {}),
|
...(passport_id ? {demographicInformation: {passport_id}} : {}),
|
||||||
registrationDate: new Date().toISOString(),
|
registrationDate: new Date().toISOString(),
|
||||||
status: code ? "active" : "paymentDue",
|
status: code ? "active" : "paymentDue",
|
||||||
|
// apparently there's an issue with the verification email system
|
||||||
|
// therefore we will skip this requirement for now
|
||||||
|
isVerified: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
await db.collection("users").insertOne(user);
|
await db.collection("users").insertOne(user);
|
||||||
@@ -117,6 +120,9 @@ async function registerCorporate(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
subscriptionExpirationDate: req.body.subscriptionExpirationDate || null,
|
subscriptionExpirationDate: req.body.subscriptionExpirationDate || null,
|
||||||
status: "paymentDue",
|
status: "paymentDue",
|
||||||
registrationDate: new Date().toISOString(),
|
registrationDate: new Date().toISOString(),
|
||||||
|
// apparently there's an issue with the verification email system
|
||||||
|
// therefore we will skip this requirement for now
|
||||||
|
isVerified: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultTeachersGroup: Group = {
|
const defaultTeachersGroup: Group = {
|
||||||
|
|||||||
@@ -77,7 +77,8 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
|
|
||||||
const queryId = req.query.id as string;
|
const queryId = req.query.id as string;
|
||||||
|
|
||||||
let user = await db.collection("users").findOne<User>({ id: queryId ? (queryId as string) : req.session.user.id });
|
const userId = queryId ? (queryId as string) : req.session.user.id
|
||||||
|
let user = await db.collection("users").findOne<User>({ id: userId });
|
||||||
const updatedUser = req.body as User & { password?: string; newPassword?: string };
|
const updatedUser = req.body as User & { password?: string; newPassword?: string };
|
||||||
|
|
||||||
if (!!queryId) {
|
if (!!queryId) {
|
||||||
@@ -160,7 +161,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
delete updatedUser.newPassword;
|
delete updatedUser.newPassword;
|
||||||
|
|
||||||
await db.collection("users").updateOne(
|
await db.collection("users").updateOne(
|
||||||
{ id: queryId },
|
{ id: userId },
|
||||||
{ $set: updatedUser }
|
{ $set: updatedUser }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user