-
Notifications
You must be signed in to change notification settings - Fork 194
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
Add scores on request page #1957
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
/> | ||
</div> | ||
</div> | ||
<button |
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.
nit: Use HcButton component
Key | ||
</label> | ||
<div className=""> | ||
<input |
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.
nit: Use TextInput
Value | ||
</label> | ||
<div className=""> | ||
<input |
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.
nit: see above
<div className="font-semibold text-gray-900 dark:text-gray-100 text-sm items-center flex"> | ||
Scores{" "} | ||
<Tooltip title="Add a new score" placement="top"> | ||
<button |
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.
nit: Use HcButton
return; | ||
} | ||
try { | ||
const res = await addRequestScore( |
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.
Q: Can a request have more than 1 score? If im understanding right, the addRequestScore
function adds a score to an array of scores?
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.
@ScottMktn Yes, request can have multiple scores but user can add scores 1 by 1 like custom properties
|
||
if (currentScores && currentScores[key]) { | ||
setNotification("Score already exists", "error"); | ||
setIsScoresAdding(false); |
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.
nit: in the future, to avoid having to set states everything for loading, use useMutation
https://tanstack.com/query/v4/docs/framework/react/reference/useMutation
For next time, for frontend stuff, please post a screenshot so that it's slightly easier to test. But otherwise, code looks good! |
Add scores on request page