Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Redm4x committed Apr 2, 2024
1 parent 38ac4a2 commit 72040a3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions api/src/utils/map/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ export const mapProviderToList = (
};

function getDistinctGpuModelsFromNodes(nodes: ProviderSnapshotNode[]) {
return nodes
.flatMap((x) => x.gpus)
.map((x) => ({ vendor: x.vendor, model: x.name, ram: x.memorySize, interface: x.interface }))
.filter((x, i, arr) => arr.findIndex((o) => x.vendor === o.vendor && x.model === o.model && x.ram === o.ram && x.interface === o.interface) === i);
const gpuModels = nodes.flatMap((x) => x.gpus).map((x) => ({ vendor: x.vendor, model: x.name, ram: x.memorySize, interface: x.interface }));
const distinctGpuModels = gpuModels.filter(
(x, i, arr) => arr.findIndex((o) => x.vendor === o.vendor && x.model === o.model && x.ram === o.ram && x.interface === o.interface) === i
);
return distinctGpuModels;
}

export const getProviderAttributeValue = (
Expand Down

0 comments on commit 72040a3

Please sign in to comment.