-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
fix challenges #1234
fix challenges #1234
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
code: string; | ||
isSuccessful: boolean; | ||
} | ||
export async function saveSubmission({ challenge, userId, code, isSuccessful }: Args) { | ||
export async function saveSubmission({ challenge, code, isSuccessful }: Args) { |
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 was taking userId and didnt even check if they were auth'd o.O
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 thought we fixed em all but guess not
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.
LGTM
const [, day = '1'] = slug.split('-'); | ||
const daysPassed = daysAfterDecemberFirst(); | ||
if (parseInt(day) > daysPassed + 1) { | ||
throw new Error('Not Available'); |
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.
lgtm, alternatively could return null
and then notFound()
in the route
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.
for sure, went with throw just because i was using findFirstOrThrow
below. so just implicitly trusted we do something good haha
if (parseInt(day) > daysPassed + 1) { | ||
throw new Error('Not Available'); | ||
} |
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.
👍
E2E report: https://04b44a3d.typehero-70p.pages.dev |
Great work!!! Perhaps we should setup a task for someone to just do a quick scan of APIs that require authorization and make sure it's directly pulling it from the session! |
lol we did but i guess we somehow missed this 😂😂 |
Description