Commit 6e492c78d1a16dfdb6bd3d569f4c130fcf815702
1 parent
44b0a110
Change device credentials value type
Showing
2 changed files
with
3 additions
and
3 deletions
... | ... | @@ -114,7 +114,7 @@ export class DeviceCredentialsDialogComponent extends |
114 | 114 | let credentialsBasic = {clientId: null, userName: null, password: null}; |
115 | 115 | if (deviceCredentials.credentialsType === DeviceCredentialsType.MQTT_BASIC) { |
116 | 116 | credentialsValue = null; |
117 | - credentialsBasic = deviceCredentials.credentialsValue as DeviceCredentialMQTTBasic; | |
117 | + credentialsBasic = JSON.parse(deviceCredentials.credentialsValue) as DeviceCredentialMQTTBasic; | |
118 | 118 | } |
119 | 119 | this.deviceCredentialsFormGroup.patchValue({ |
120 | 120 | credentialsType: deviceCredentials.credentialsType, |
... | ... | @@ -183,7 +183,7 @@ export class DeviceCredentialsDialogComponent extends |
183 | 183 | this.submitted = true; |
184 | 184 | const deviceCredentialsValue = this.deviceCredentialsFormGroup.value; |
185 | 185 | if (deviceCredentialsValue.credentialsType === DeviceCredentialsType.MQTT_BASIC) { |
186 | - deviceCredentialsValue.credentialsValue = deviceCredentialsValue.credentialsBasic; | |
186 | + deviceCredentialsValue.credentialsValue = JSON.stringify(deviceCredentialsValue.credentialsBasic); | |
187 | 187 | } |
188 | 188 | delete deviceCredentialsValue.credentialsBasic; |
189 | 189 | this.deviceCredentials = {...this.deviceCredentials, ...deviceCredentialsValue}; | ... | ... |
... | ... | @@ -308,7 +308,7 @@ export interface DeviceCredentials extends BaseData<DeviceCredentialsId> { |
308 | 308 | deviceId: DeviceId; |
309 | 309 | credentialsType: DeviceCredentialsType; |
310 | 310 | credentialsId: string; |
311 | - credentialsValue: string | DeviceCredentialMQTTBasic; | |
311 | + credentialsValue: string; | |
312 | 312 | } |
313 | 313 | |
314 | 314 | export interface DeviceCredentialMQTTBasic { | ... | ... |