mirror of
https://github.com/Telecominfraproject/wlan-cloud-graphql-gw.git
synced 2025-11-01 11:07:54 +00:00
fixed OSU SSID edge case
This commit is contained in:
@@ -267,6 +267,32 @@ export class API extends RESTDataSource {
|
|||||||
details: { passpointProfileId, passpointConfig },
|
details: { passpointProfileId, passpointConfig },
|
||||||
} = profile;
|
} = profile;
|
||||||
|
|
||||||
|
const oldProfile = await this.get('portal/profile', { profileId: id });
|
||||||
|
if (oldProfile.childProfileIds.length) {
|
||||||
|
const childProfiles = await this.get('portal/profile/inSet', {
|
||||||
|
profileIdSet: oldProfile.childProfileIds,
|
||||||
|
});
|
||||||
|
const passpointProfile = childProfiles.find(
|
||||||
|
(profile) => profile.profileType === 'passpoint'
|
||||||
|
);
|
||||||
|
if (passpointProfile) {
|
||||||
|
this.put('portal/profile', {
|
||||||
|
...passpointProfile,
|
||||||
|
details: {
|
||||||
|
...passpointProfile.details,
|
||||||
|
...(passpointProfile.details.osuSsidProfileId === parseInt(id, 10) && {
|
||||||
|
osuSsidProfileId: null,
|
||||||
|
}),
|
||||||
|
...(passpointProfile.details.associatedAccessSsidProfileIds && {
|
||||||
|
associatedAccessSsidProfileIds: passpointProfile.details.associatedAccessSsidProfileIds.filter(
|
||||||
|
(i) => i !== parseInt(id, 10)
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (passpointConfig === 'accessSSID') {
|
if (passpointConfig === 'accessSSID') {
|
||||||
this.get('portal/profile', {
|
this.get('portal/profile', {
|
||||||
profileId: passpointProfileId.value,
|
profileId: passpointProfileId.value,
|
||||||
@@ -312,32 +338,6 @@ export class API extends RESTDataSource {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
const oldProfile = await this.get('portal/profile', { profileId: id });
|
|
||||||
if (oldProfile.childProfileIds.length) {
|
|
||||||
const childProfiles = await this.get('portal/profile/inSet', {
|
|
||||||
profileIdSet: oldProfile.childProfileIds,
|
|
||||||
});
|
|
||||||
const passpointProfile = childProfiles.find(
|
|
||||||
(profile) => profile.profileType === 'passpoint'
|
|
||||||
);
|
|
||||||
if (passpointProfile) {
|
|
||||||
this.put('portal/profile', {
|
|
||||||
...passpointProfile,
|
|
||||||
details: {
|
|
||||||
...passpointProfile.details,
|
|
||||||
...(passpointProfile.details.osuSsidProfileId === parseInt(id, 10) && {
|
|
||||||
osuSsidProfileId: null,
|
|
||||||
}),
|
|
||||||
...(passpointProfile.details.associatedAccessSsidProfileIds && {
|
|
||||||
associatedAccessSsidProfileIds: passpointProfile.details.associatedAccessSsidProfileIds.filter(
|
|
||||||
(i) => i !== parseInt(id, 10)
|
|
||||||
),
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user