Skip to content

Limit TEC Requests - BE Validation#617

Open
patriciaahuang wants to merge 1 commit intomainfrom
tec-be-validation
Open

Limit TEC Requests - BE Validation#617
patriciaahuang wants to merge 1 commit intomainfrom
tec-be-validation

Conversation

@patriciaahuang
Copy link
Copy Markdown
Contributor

Check in the backend that

  • the maximum credits cannot be greater than the team event credit
  • the maximum credits is a multiple of the team event credit

@patriciaahuang patriciaahuang requested a review from a team as a code owner May 6, 2024 15:51
@dti-github-bot
Copy link
Copy Markdown
Member

[diff-counting] Significant lines: 12.

Copy link
Copy Markdown
Collaborator

@henry-li-06 henry-li-06 left a comment

Choose a reason for hiding this comment

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

I think requestTeamEventCredit also needs this check right?

Comment on lines +51 to +56
if (Number(teamEventInfo.numCredits) > Number(teamEventInfo.maxCredits))
throw new BadRequestError('The maximum credits cannot be greater than the team event credit!');
if (Number(teamEventInfo.maxCredits) % Number(teamEventInfo.numCredits) !== 0)
throw new BadRequestError(
'The maximum credits needs to be a multiple of the team event credit!'
);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

could be nice to pull out a shared helper for this between this func and updateTeamEvent

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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