Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
findolor committed Feb 15, 2025
1 parent 5ec4a3b commit 1eb6a20
Showing 1 changed file with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,10 @@ export const load: LayoutLoad = async ({ params, parent }) => {
const { deploymentKey } = params;
const { dotrain } = (await parent()) as unknown as LayoutParentData;

// Process deployments for both raw and registry strategies
const deploymentWithDetails = await DotrainOrderGui.getDeploymentDetails(dotrain);
const deployments = Array.from(deploymentWithDetails, ([key, details]) => ({
key,
...details
}));

const deployment = deployments.find(
(deployment: { key: string }) => deployment.key === deploymentKey
const { name, description } = await DotrainOrderGui.getDeploymentDetail(
dotrain,
deploymentKey || ''
);

if (!deployment) {
throw new Error(`Deployment ${deploymentKey} not found`);
}

return { deployment, dotrain };
return { deployment: { key: deploymentKey, name, description }, dotrain };
};

0 comments on commit 1eb6a20

Please sign in to comment.