store/cockpitApi: use existing blueprint converter
Use the blueprint existing blueprint converter to convert the on-prem blueprint to the hosted blueprint
This commit is contained in:
parent
a9ebfb7e2e
commit
47156c4e95
1 changed files with 5 additions and 4 deletions
|
|
@ -17,6 +17,7 @@ import {
|
|||
BlueprintItem,
|
||||
} from './imageBuilderApi';
|
||||
|
||||
import { mapOnPremToHosted } from '../Components/Blueprints/helpers/onPremToHostedBlueprintMapper';
|
||||
import { BLUEPRINTS_DIR } from '../constants';
|
||||
|
||||
const getBlueprintsPath = async () => {
|
||||
|
|
@ -61,12 +62,12 @@ export const cockpitApi = emptyCockpitApi.injectEndpoints({
|
|||
const parsed = toml.parse(contents);
|
||||
file.close();
|
||||
|
||||
// TODO: using the existing blueprint converter
|
||||
const blueprint = mapOnPremToHosted(parsed);
|
||||
const version = (parsed.version as number) ?? 1;
|
||||
return {
|
||||
name: parsed.name as string,
|
||||
...blueprint,
|
||||
id: filename as string,
|
||||
version: parsed.version as number,
|
||||
description: parsed.description as string,
|
||||
version: Math.floor(version),
|
||||
last_modified_at: Date.now().toString(),
|
||||
};
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue