@@ -44,6 +44,7 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy {
44
44
uploadedLogoResponse ! : IUploadedLogoresponse
45
45
organizationNameList : string [ ] = [ ]
46
46
ORG_NAME_PATTERN = / ^ [ a - z A - Z 0 - 9 ( ) . , @ \- \$ \/ \\ : \[ \] ! \s ] * $ /
47
+ rootOrgId : any
47
48
48
49
untilDestroyed$ = new Subject < void > ( ) ;
49
50
isMatcompleteOpened = false
@@ -56,7 +57,7 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy {
56
57
private snackBar : MatSnackBar ,
57
58
private createMDOService : CreateMDOService ,
58
59
private activatedRoute : ActivatedRoute ,
59
- private loaderService : LoaderService
60
+ private loaderService : LoaderService ,
60
61
) {
61
62
62
63
this . addOverflowHidden ( )
@@ -217,6 +218,8 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy {
217
218
}
218
219
219
220
onSubmitCreateOrganization ( ) {
221
+ const userProfile = _ . get ( this . activatedRoute , 'snapshot.parent.data.configService.userProfile' )
222
+ this . rootOrgId = userProfile . rootOrgId
220
223
let payload : any = {
221
224
orgName : this . controls [ 'organisationName' ] ?. value || "" ,
222
225
channel : this . controls [ 'organisationName' ] ?. value || "" ,
@@ -227,8 +230,10 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy {
227
230
logo : this . uploadedLogoResponse ?. qrcodepath || "" ,
228
231
description : this . controls [ 'description' ] ?. value || "" ,
229
232
parentMapId : "" ,
233
+ sbRootOrgId : this . rootOrgId
234
+
230
235
}
231
- // if (this.heirarchyObject.sbRootOrgId) {
236
+ // if (this.heirarchyObject && this.heirarchyObject .sbRootOrgId) {
232
237
// payload['sbRootOrgId'] = this.heirarchyObject.sbRootOrgId
233
238
// }
234
239
if ( this . controls [ 'category' ] ?. value === 'state' ) {
0 commit comments