mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 17:23:37 +00:00
support camel or pascal case in API responses
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { BaseResponse } from './baseResponse';
|
||||
|
||||
import { DeviceType } from '../../enums/deviceType';
|
||||
|
||||
export class DeviceResponse {
|
||||
export class DeviceResponse extends BaseResponse {
|
||||
id: string;
|
||||
name: number;
|
||||
identifier: string;
|
||||
@@ -8,10 +10,11 @@ export class DeviceResponse {
|
||||
creationDate: string;
|
||||
|
||||
constructor(response: any) {
|
||||
this.id = response.Id;
|
||||
this.name = response.Name;
|
||||
this.identifier = response.Identifier;
|
||||
this.type = response.Type;
|
||||
this.creationDate = response.CreationDate;
|
||||
super(response);
|
||||
this.id = this.getResponseProperty('Id');
|
||||
this.name = this.getResponseProperty('Name');
|
||||
this.identifier = this.getResponseProperty('Identifier');
|
||||
this.type = this.getResponseProperty('Type');
|
||||
this.creationDate = this.getResponseProperty('CreationDate');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user