Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up AWS Cognito for log-in #13

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Set up AWS Cognito for log-in #13

wants to merge 6 commits into from

Conversation

@hams7504 hams7504 marked this pull request as draft April 1, 2024 22:05
import { ApplicationStatus } from './types';

@Entity()
export class Application {
Copy link

Choose a reason for hiding this comment

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

Is there a schema/description of what data we're working with here? I'm curious how this connects to other pieces of data we'll have

Copy link

Choose a reason for hiding this comment

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

also, what does an Application represent? Is it someone's application to join the site?

) {}

@Post('/signup')
async createUser(@Body() signUpDto: SignUpRequestDTO): Promise<Application> {
Copy link

Choose a reason for hiding this comment

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

Do we also want to create a user record here through the UsersService? Or are we planning on taking care of that in another way somewhere else?

Comment on lines +61 to +64
async findOne(currentUser: User, userId: number): Promise<User> {
const user = await this.usersRepository.findOne({
where: { id: userId }
});
Copy link

Choose a reason for hiding this comment

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

I think we can split this method up (or if not, maybe rename to something more descriptive) - from what I understand, right now it's doing two things: fetching a user by ID (and making sure they actually exist), and making sure the calling user is allowed to access the fetched user. I imagine we might want to do either of those things independently of each other, and having the two different methods would be super helpful then.

Comment on lines +24 to +26
@Column('varchar')
@IsBoolean()
safety?: boolean;
Copy link

Choose a reason for hiding this comment

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

I'm not super familiar with data in Nest, so a couple questions here:

  • Are the @IsBoolean() (and related decorators) necessary? I don't see them in the scaffolding repo - was there some edge case you ran into while building this?
  • How does defining the column as varchar and typing it as a boolean end up storing the record? Is it stored as text (like "true" or "false")?
  • Does marking the field as optional with ? do the same thing as adding the IsOptional() decorator?

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.

2 participants