Skip to content

Commit

Permalink
fix: set correct status code for GET /downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
theoludwig committed Mar 22, 2021
1 parent 458ff93 commit 690f184
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/src/api/downloads/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const getDownloads = async (fastify, options) => {
if (err && err.code === 'ENOENT') {
message = 'There is no content to download for this module.'
log.error(message)
reply.send({
reply.code(404).send({
success: false,
status: 404,
code: 'module_dir_not_found',
Expand Down Expand Up @@ -104,7 +104,7 @@ const getDownloads = async (fastify, options) => {
} else {
message = 'This module does not exist.'
log.error(message)
reply.send({
reply.code(404).send({
success: false,
status: 404,
code: 'module_not_found',
Expand All @@ -114,7 +114,7 @@ const getDownloads = async (fastify, options) => {
} else {
message = 'Bad request.'
log.error(message)
reply.send({
reply.code(400).send({
success: false,
status: 400,
code: 'bad_request',
Expand Down

0 comments on commit 690f184

Please sign in to comment.