fix: extend landing period button not working on android

Closes #333
This commit is contained in:
Jovan Krunić
2022-11-02 18:13:31 +01:00
committed by Rainer Killinger
parent f7726378f4
commit 0caa69c28c

View File

@@ -34,7 +34,11 @@ export class CapacitorRequestor extends Requestor {
private async post<T>(url: string, data: any, headers: HttpHeaders) {
return CapacitorHttp.post({
url,
data: this.decodeURLSearchParams(data),
// Workaround for CapacitorHttp bug (JSONException when "x-www-form-urlencoded" text is provided)
data:
headers['Content-Type'] === 'application/x-www-form-urlencoded'
? this.decodeURLSearchParams(data)
: data,
headers,
}).then((response: HttpResponse) => {
return response.data as T;
@@ -45,7 +49,11 @@ export class CapacitorRequestor extends Requestor {
private async put<T>(url: string, data: any, headers: HttpHeaders) {
return CapacitorHttp.put({
url,
data: this.decodeURLSearchParams(data),
// Workaround for CapacitorHttp bug (JSONException when "x-www-form-urlencoded" text is provided)
data:
headers['Content-Type'] === 'application/x-www-form-urlencoded'
? this.decodeURLSearchParams(data)
: data,
headers,
}).then((response: HttpResponse) => response.data as T);
}