Skip to content

Commit

Permalink
fix return type
Browse files Browse the repository at this point in the history
  • Loading branch information
solaoi committed Mar 19, 2022
1 parent ef29a09 commit 3ef4ddc
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/api/[[...slug]].ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ const Handler: BlitzApiHandler = async (req: BlitzApiRequest, res: BlitzApiRespo
method,
} = req
if (!Array.isArray(slug)) {
return res.status(404).end()
res.status(404).end()
return
}
const obj = await dynamicHandler(method, slug)
if (!obj) {
return res.status(404).end()
res.status(404).end()
return
}
const {
id,
Expand Down Expand Up @@ -87,9 +89,10 @@ const Handler: BlitzApiHandler = async (req: BlitzApiRequest, res: BlitzApiRespo
])

if (inNtimesErrorTerm) {
return res.status(Number(ntimesErrorStatusCode)).end()
res.status(Number(ntimesErrorStatusCode)).end()
return
}
return res.status(Number(statusCode)).setHeader("Content-Type", contentType).end(response)
res.status(Number(statusCode)).setHeader("Content-Type", contentType).end(response)
}

export default Handler

0 comments on commit 3ef4ddc

Please sign in to comment.