Skip to content

Commit

Permalink
fix: assert type of request
Browse files Browse the repository at this point in the history
  • Loading branch information
seo-rii committed Jan 6, 2022
1 parent 0381b9d commit 284c42e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
20 changes: 8 additions & 12 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ app.post('/judge', (req, res) => {
memoryLimit: req.body.memoryLimit,
specialJudge: req.body.specialJudge,
} as JudgeRequest
if(is<JudgeRequest>(problem)) {
if (is<JudgeRequest>(problem)) {
requestJudge(problem)
res.send({ success: true, uid: problem.uid })
}
else {
} else {
res.status(400)
res.send({ success: false })
}
Expand Down

0 comments on commit 284c42e

Please sign in to comment.