feat(caprover): display application logs for apps with pending updates
This commit is contained in:
@@ -1,9 +1,4 @@
|
||||
import {
|
||||
http,
|
||||
HttpResponse,
|
||||
HttpResponseResolver,
|
||||
PathParams
|
||||
} from "msw";
|
||||
import { http, HttpResponse, HttpResponseResolver, PathParams } from "msw";
|
||||
import { setupServer } from "msw/node";
|
||||
import appsFixtures from "./apps.fixtures.json";
|
||||
|
||||
@@ -97,6 +92,27 @@ const handlers = [
|
||||
data: {},
|
||||
});
|
||||
}),
|
||||
http.get(
|
||||
`${BASE_URI}/user/apps/appData/:name/logs`,
|
||||
withAuth(({ params }) => {
|
||||
const app = appsFixtures.find((app) => app.appName === params.name);
|
||||
if (!app) {
|
||||
return HttpResponse.json({
|
||||
status: 1000,
|
||||
description: `App (${params.name}) could not be found. Make sure that you have created the app.`,
|
||||
data: {},
|
||||
});
|
||||
}
|
||||
|
||||
return HttpResponse.json({
|
||||
status: 100,
|
||||
description: "App runtime logs are retrieved",
|
||||
data: {
|
||||
logs: `${params.name} logs`,
|
||||
},
|
||||
});
|
||||
})
|
||||
),
|
||||
];
|
||||
|
||||
const server = setupServer(...handlers);
|
||||
|
||||
Reference in New Issue
Block a user