1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/main/routes/helm/charts/get-values-route.injectable.ts
Sebastian Malton 79c06a0fd4 Override lensFetchInjectable in ApplicationBuilder
- So that we can request from the backend routes

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-01-19 09:37:25 -05:00

30 lines
975 B
TypeScript

/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getRouteInjectable } from "../../../router/route-request.injectable";
import { apiPrefix } from "../../../../common/vars";
import { route } from "../../../router/route";
import getHelmChartValuesInjectable from "../../../helm/helm-service/get-helm-chart-values.injectable";
const getHelmChartRouteValuesInjectable = getRouteInjectable({
id: "get-helm-chart-values-route",
instantiate: (di) => {
const getHelmChartValues = di.inject(getHelmChartValuesInjectable);
return route({
method: "get",
path: `${apiPrefix}/v2/charts/{repo}/{chart}/values`,
})(async ({ params, query }) => ({
response: await getHelmChartValues(
params.repo,
params.chart,
query.get("version") ?? undefined,
),
}));
},
});
export default getHelmChartRouteValuesInjectable;