Skip to content
23 changes: 23 additions & 0 deletions backend/src/routes/pullRequestRoutes.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { json, readJson } from "../http.ts";
import { errorMessage, httpStatusCode } from "../lib/errors.ts";
import {
getDashboardReleaseStatus,
getProductionCheckoutStatus,
listDashboardPullRequests,
prepareAndStartDeployLatest,
prepareAndStartRollback,
readDeploymentJobs,
runPullRequestApproval,
runPullRequestBranchUpdate,
Expand Down Expand Up @@ -117,6 +119,27 @@ export const pullRequestRoutes = {
}
},
},
"/api/pull-requests/releases": {
GET: async () => {
try {
return json({ release: await getDashboardReleaseStatus() });
} catch (error) {
return routeError(error);
}
},
},
"/api/pull-requests/releases/rollback": {
POST: async () => {
try {
return json({
deployment: await prepareAndStartRollback(),
isOk: true,
});
} catch (error) {
return routeError(error);
}
},
},
"/api/pull-requests/production-checkout": {
GET: async () => {
try {
Expand Down
Loading