@@ -4,6 +4,7 @@ import { createBrandedValue } from '@unocha/hpc-api-core/src/util/types';
4
4
import { groupBy } from 'lodash' ;
5
5
import { Service } from 'typedi' ;
6
6
import Context from '../Context' ;
7
+ import { GlobalClusterService } from '../global-cluster/global-cluster-service' ;
7
8
import { LocationService } from '../location/location-service' ;
8
9
import { OrganizationService } from '../organization/organization-service' ;
9
10
import { PlanService } from '../plans/plan-service' ;
@@ -13,6 +14,7 @@ import { UsageYearService } from '../usage-year/usage-year-service';
13
14
@Service ( )
14
15
export class FlowObjectService {
15
16
constructor (
17
+ private globalClusterService : GlobalClusterService ,
16
18
private locationService : LocationService ,
17
19
private projectService : ProjectService ,
18
20
private planService : PlanService ,
@@ -38,6 +40,15 @@ export class FlowObjectService {
38
40
const typedObjects = await Promise . all (
39
41
Object . entries ( groupBy ( flowObjects , 'objectType' ) ) . map (
40
42
async ( [ type , flowObjects ] ) => {
43
+ if ( type === 'globalCluster' ) {
44
+ return [
45
+ 'globalClusters' ,
46
+ await this . globalClusterService . findByIds (
47
+ context . models ,
48
+ flowObjects . map ( ( fo ) => fo . objectID )
49
+ ) ,
50
+ ] ;
51
+ }
41
52
if ( type === 'location' ) {
42
53
return [
43
54
'locations' ,
0 commit comments