mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
- So that we can request from the backend routes Signed-off-by: Sebastian Malton <sebastian@malton.name>
30 lines
975 B
TypeScript
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;
|