1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 06:13:38 +00:00

[AC-1944] Add provider billing history component (#9520)

* Add provider-billing-history.component

* Implement provider client invoice export
This commit is contained in:
Alex Morask
2024-06-14 12:27:49 -04:00
committed by GitHub
parent 215bbc2f8e
commit af53df09ac
15 changed files with 270 additions and 0 deletions

View File

@@ -1883,9 +1883,12 @@ export class ApiService implements ApiServiceAbstraction {
const responseType = response.headers.get("content-type");
const responseIsJson = responseType != null && responseType.indexOf("application/json") !== -1;
const responseIsCsv = responseType != null && responseType.indexOf("text/csv") !== -1;
if (hasResponse && response.status === 200 && responseIsJson) {
const responseJson = await response.json();
return responseJson;
} else if (hasResponse && response.status === 200 && responseIsCsv) {
return await response.text();
} else if (response.status !== 200) {
const error = await this.handleError(response, false, authed);
return Promise.reject(error);