mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
support camel or pascal case in API responses
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
export class AttachmentResponse {
|
||||
import { BaseResponse } from './baseResponse';
|
||||
|
||||
export class AttachmentResponse extends BaseResponse {
|
||||
id: string;
|
||||
url: string;
|
||||
fileName: string;
|
||||
@@ -7,11 +9,12 @@ export class AttachmentResponse {
|
||||
sizeName: string;
|
||||
|
||||
constructor(response: any) {
|
||||
this.id = response.Id;
|
||||
this.url = response.Url;
|
||||
this.fileName = response.FileName;
|
||||
this.key = response.Key;
|
||||
this.size = response.Size;
|
||||
this.sizeName = response.SizeName;
|
||||
super(response);
|
||||
this.id = this.getResponseProperty('Id');
|
||||
this.url = this.getResponseProperty('Url');
|
||||
this.fileName = this.getResponseProperty('FileName');
|
||||
this.key = this.getResponseProperty('Key');
|
||||
this.size = this.getResponseProperty('Size');
|
||||
this.sizeName = this.getResponseProperty('SizeName');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user