mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
chore: Switch buildVersion to use new Initializable
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
72a01cdc17
commit
1b96a94c14
26 files changed
+105
-152
No files matched your search
@@ -4,23 +4,19 @@
|
||||
*/
|
||||
import { getRouteInjectable } from "../../router/router.injectable";
|
||||
import { route } from "../../router/route";
|
||||
import buildVersionInjectable from "../../vars/build-version/build-version.injectable";
|
||||
import { buildVersionInitializable } from "../../../features/vars/build-version/common/token";
|
||||
|
||||
const getVersionRouteInjectable = getRouteInjectable({
|
||||
id: "get-version-route",
|
||||
|
||||
instantiate: (di) => {
|
||||
const buildVersion = di.inject(buildVersionInjectable);
|
||||
|
||||
return route({
|
||||
method: "get",
|
||||
path: `/version`,
|
||||
})(() => ({
|
||||
response: {
|
||||
version: buildVersion.get(),
|
||||
},
|
||||
}));
|
||||
},
|
||||
instantiate: (di) => route({
|
||||
method: "get",
|
||||
path: `/version`,
|
||||
})(() => ({
|
||||
response: {
|
||||
version: di.inject(buildVersionInitializable.stateToken),
|
||||
},
|
||||
})),
|
||||
});
|
||||
|
||||
export default getVersionRouteInjectable;
|
||||
Reference in new issue
Block a user