-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: Complete challenge rewards #62
base: main
Are you sure you want to change the base?
Conversation
fcd6934
to
4af92f1
Compare
(repo) => sluggify(repo?.challenge?.title) === sluggify(challenge.title) | ||
); | ||
|
||
const isCompleted = repository?.progress?.status === Status.Completed; |
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.
The Status.Completed in types folder is not the same as the one for progress status.
const isCompleted = repository?.progress?.status === Status.Completed; | |
const isCompleted = repository?.progress?.status === "completed"; |
</p> | ||
</section> | ||
</div> | ||
{isCompleted ? ( |
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.
This will always pay the user when they come to the challenge page after they've completed the challenge
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.
The user should be paid once only
I've tested it with my blink account and it works. You need to define 3 env variables in vercel to get this to work:
BLINK_API_TOKEN
REWARD_IN_SATS
BLINK_WALLET_ID
I've DM'd you the values for these. It uses basic rate limiting for now to try and make it harder to exploit the endpoint.
The only part I haven't been able to test is if it works correctly with the course progress. You might need to fix that part up before merging.