1
0
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:
Kyle Spearrin
2019-03-01 00:13:37 -05:00
parent 62e9c75357
commit 48164a31d9
43 changed files with 637 additions and 449 deletions

View File

@@ -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');
}
}