Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
farisashai
left a comment
There was a problem hiding this comment.
I had a better idea after the last PR I did for the admin page - check box that says "Award to all Users" and if it's true it disables the user field and creates a milestone instead since it's technically the same award points functionality under a different name. That way we condense 2 pages in one
|
|
||
| const onSubmit: SubmitHandler<FormValues> = () => { | ||
| // TODO | ||
| const onSubmit: SubmitHandler<FormValues> = async ({ email, description, points }) => { |
There was a problem hiding this comment.
wrap this in an admin event manager function for repo conventions and also error handling
SheepTester
left a comment
There was a problem hiding this comment.
looks fine to me. I think it's a bit weird that EventAPI.awardBonusPoints directly returns the response object rather than the emails Promise<string[]>, but at the same time I think it'd be confusing if a function named awardBonusPoints returned a list of emails
|
|
||
| const requestBody: CreateBonusRequest = { | ||
| bonus: { | ||
| users: [user], |
There was a problem hiding this comment.
Maybe you should have awardBonusPoints accept a list of users since the backend supports it, and the function returns a list of emails rather than just one
|
|
||
| export const awardBonusPoints = async ( | ||
| token: string, | ||
| user: string, |
There was a problem hiding this comment.
Is this a username or user UUID?
| user: string, | |
| username: string, |
| user: string, | |
| user: UUID, |
(or userId: UUID)
Info
Closes [ISSUE NUMBER].
[description]
Changes
Type of Change
expected)
linting/formatting)
workflows)
Testing
I have tested that my changes fully resolve the linked issue ...
Checklist
/src/lib/*and commented hard to understand areasanywhere else.
Screenshots