-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement award points page #122
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -20,8 +22,10 @@ const AwardPointsPage: NextPage = () => { | |||
formState: { errors }, | |||
} = useForm<FormValues>(); | |||
|
|||
const onSubmit: SubmitHandler<FormValues> = () => { | |||
// TODO | |||
const onSubmit: SubmitHandler<FormValues> = async ({ email, description, points }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrap this in an admin event manager function for repo conventions and also error handling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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