Skip to content

Commit d869984

Browse files
authored
Merge pull request #29 from PurdueRCAC/fix-frontend
Fix JSON parse errors on frontend
2 parents 30156ba + 5836169 commit d869984

13 files changed

Lines changed: 29 additions & 23 deletions

File tree

backend/src/handlers/acceptInvitation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ export const acceptInvitationHandler: HandlerMap["acceptInvitation"] = async (
2121
throw e;
2222
}
2323

24-
return empty(200, res);
24+
return empty(204, res);
2525
};

backend/src/handlers/claimOrg.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ export const claimOrgHandler: HandlerMap["claimOrg"] = async (
3030
}
3131
throw e;
3232
}
33-
return empty(200, res);
33+
return empty(204, res);
3434
};

backend/src/handlers/createAppGroup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const createAppGroupHandler: HandlerMap["createAppGroup"] = async (
1818

1919
try {
2020
await createAppGroup(req.user.id, data.orgId, data.name, data.apps);
21-
return empty(200, res);
21+
return empty(204, res);
2222
} catch (e) {
2323
if (e instanceof AppCreateError) {
2424
const ex = e.cause!;

backend/src/handlers/deleteApp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const deleteAppHandler: HandlerMap["deleteApp"] = async (
1212
const appId = ctx.request.params.appId;
1313
try {
1414
await deleteApp(appId, req.user.id, ctx.request.requestBody.keepNamespace);
15-
return empty(200, res);
15+
return empty(204, res);
1616
} catch (e) {
1717
if (e instanceof AppNotFoundError) {
1818
return json(404, res, { code: 404, message: "App not found" });

backend/src/handlers/deleteOrgByID.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ export const deleteOrgByIDHandler: HandlerMap["deleteOrgByID"] = async (
1818
}
1919
}
2020

21-
return empty(200, res);
21+
return empty(204, res);
2222
};

backend/src/handlers/githubWebhook.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ export const githubWebhookHandler: HandlerMap["githubWebhook"] = async (
3535

3636
try {
3737
await processGitHubWebhookPayload(requestType, action, JSON.parse(data));
38-
return empty(200, res);
38+
return empty(204, res);
3939
} catch (e) {
4040
if (e instanceof ValidationError) {
4141
return json(400, res, { code: 400, message: e.message });
4242
} else if (e instanceof AppNotFoundError) {
4343
// GitHub sent a webhook about a repository, but it's not linked to any apps - nothing to do here
44-
return empty(200, res);
44+
return empty(204, res);
4545
} else if (e instanceof UnknownWebhookRequestTypeError) {
4646
// GitHub sent a webhook payload that we don't care about
4747
return empty(422, res);

backend/src/handlers/ingestLogs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const ingestLogsHandler: HandlerMap["ingestLogs"] = async (
3232
logType,
3333
ctx.request.requestBody.lines,
3434
);
35-
return empty(200, res);
35+
return empty(204, res);
3636
} catch (e) {
3737
if (e instanceof DeploymentNotFoundError) {
3838
// No deployment matches the ID and secret

backend/src/handlers/setAppCD.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const setAppCDHandler: HandlerMap["setAppCD"] = async (
1414
req.user.id,
1515
ctx.request.requestBody.enable,
1616
);
17-
return empty(200, res);
17+
return empty(204, res);
1818
} catch (e) {
1919
if (e instanceof AppNotFoundError) {
2020
return json(404, res, { code: 404, message: "App not found." });

backend/src/handlers/updateApp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const updateAppHandler: HandlerMap["updateApp"] = async (
1515
const appData = ctx.request.requestBody;
1616
try {
1717
await updateApp(ctx.request.params.appId, req.user.id, appData);
18-
return empty(200, res);
18+
return empty(204, res);
1919
} catch (e) {
2020
if (e instanceof AppNotFoundError) {
2121
return json(404, res, { code: 404, message: "App not found" });

backend/src/handlers/updateDeployment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const updateDeploymentHandler: HandlerMap["updateDeployment"] = async (
1414
const { secret, status } = ctx.request.requestBody;
1515
try {
1616
await updateDeployment(secret, status);
17-
return empty(200, res);
17+
return empty(204, res);
1818
} catch (e) {
1919
if (e instanceof ValidationError) {
2020
return json(404, res, { code: 400, message: e.message });

0 commit comments

Comments
 (0)