TASK22102: slice4 larger file set + production detail suppression
This commit is contained in:
@@ -12,6 +12,7 @@ import _ from "lodash";
|
||||
|
||||
import nextConnect from "next-connect";
|
||||
import middleware from "../middleware/middleware";
|
||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
||||
|
||||
const ApiProxy = nextConnect();
|
||||
ApiProxy.use(middleware);
|
||||
@@ -30,7 +31,11 @@ ApiProxy.get(async (req, res) => {
|
||||
typeof checkHash === "undefined" ||
|
||||
checkHash.length === 0
|
||||
) {
|
||||
return res.status(400).json();
|
||||
return respondError(res, {
|
||||
status: 400,
|
||||
code: "MISSING_REQUIRED_QUERY",
|
||||
message: "container, tempcaseref and hash are required"
|
||||
});
|
||||
}
|
||||
|
||||
var checkquerypath =
|
||||
@@ -40,7 +45,11 @@ ApiProxy.get(async (req, res) => {
|
||||
tempCaseRef;
|
||||
|
||||
if (hashAPIPath(checkquerypath) != "&hash=" + checkHash) {
|
||||
return res.status(400).json();
|
||||
return respondError(res, {
|
||||
status: 400,
|
||||
code: "INVALID_HASH",
|
||||
message: "Invalid hash"
|
||||
});
|
||||
}
|
||||
|
||||
const blobProgress = await getProgressBlobs(
|
||||
@@ -107,14 +116,18 @@ ApiProxy.get(async (req, res) => {
|
||||
}
|
||||
|
||||
createCaseCompleteMessage(containerName, tempCaseRef);
|
||||
return res.status(200).json({
|
||||
return respondSuccess(res, {
|
||||
status: "success"
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
return res.status(400).json(error);
|
||||
return respondError(res, {
|
||||
status: 400,
|
||||
code: "CREATE_APPEAL_COMPLETE_MESSAGE_FAILED",
|
||||
message: "Failed to create appeal complete message"
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user