Skip to content

Conversation

@adarshm11
Copy link
Contributor

No description provided.

Copy link
Member

@n8thantran n8thantran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

"LED_SIGN": {
"ENABLED": false
},
"LEETCODE_URL": "NOT_SET",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this change in development vs prod

if it wouldnt, can we just do an ENABLED true/false

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

const AuditLog = require('../models/AuditLog.js');
const membershipState = require('../../util/constants').MEMBERSHIP_STATE;

router.get('/getAllUsers', async (req, res) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make life simple

Suggested change
router.get('/getAllUsers', async (req, res) => {
router.get('/', async (req, res) => {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +42 to +43
{ value: firstName, title: 'User\'s first name', },
{ value: lastName, title: 'User\'s last name', }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need first and last name? up to you

if we just do username does that hurt anything, would be simpler

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

names = easy to tell who's who on frontend
like who gonna know who "doggymuncher" is if there's no names you get what i mean

Comment on lines 48 to 59
const doesUserExist = await checkIfUserExists(leetcodeUsername, token);
if (doesUserExist.responseData) {
setIsError(true);
setMessage('This username is already registered, please try again');
return;
}
const newUser = {
username: leetcodeUsername,
firstName,
lastName
};
if (!await addUser(newUser, token)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isntead of a second endpoint you could have the create api check if they exist

the create api can return 409, and if the frontend gets 409 then we just say they already are registered

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants