Skip to content

Commit

Permalink
Merge pull request #10 from PolkadotEducation/artur-isAdmin-fix
Browse files Browse the repository at this point in the history
Remove isAdmin from createUser() (POST /users)
  • Loading branch information
arturgontijo authored Aug 29, 2024
2 parents 6415e1a + da85c97 commit 799d60a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/controllers/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { sendVerificationEmail } from "@/helpers/aws/ses";

export const createUser = async (req: Request, res: Response) => {
try {
const { email, password, name, company, isAdmin } = req.body;
const { email, password, name, company } = req.body;
if (!email || !password) return res.status(400).send({ error: { message: "Missing email or password" } });

const newUser = await UserModel.createUser(email, password, name, company, isAdmin);
const newUser = await UserModel.createUser(email, password, name, company);
if (newUser) {
await sendVerificationEmail(email, newUser.verifyToken!);
newUser.verifyToken = undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/models/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class User extends BaseModel {
password: string,
name: string,
company: string,
isAdmin: boolean,
isAdmin?: boolean,
): Promise<UserInfo | undefined> {
try {
const exists = await this.findOne({ email: email.toLowerCase() });
Expand Down

0 comments on commit 799d60a

Please sign in to comment.