1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 07:49:41 +02:00
portainer/app/azure/models/provider.ts

21 lines
472 B
TypeScript

import _ from 'lodash';
import { ProviderResponse } from '../types';
export interface ProviderViewModel {
id: string;
namespace: string;
locations: string[];
}
export function parseViewModel({
id,
namespace,
resourceTypes,
}: ProviderResponse): ProviderViewModel {
const containerGroupType = _.find(resourceTypes, {
resourceType: 'containerGroups',
});
const { locations = [] } = containerGroupType || {};
return { id, namespace, locations };
}