money-lover-app-client 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +5 -2
- package/dist/bundle.js.map +1 -1
- package/dist/client.d.ts +1 -0
- package/package.json +36 -36
package/dist/bundle.js
CHANGED
|
@@ -6437,7 +6437,7 @@ class MoneyLoverClient {
|
|
|
6437
6437
|
constructor() {
|
|
6438
6438
|
this._jwtToken = null;
|
|
6439
6439
|
}
|
|
6440
|
-
async _postRequest(path, body =
|
|
6440
|
+
async _postRequest(path, body = {}, headers = {}) {
|
|
6441
6441
|
const res = await fetch(`${moneyLoverUrl}/api${path}`, {
|
|
6442
6442
|
method: "POST",
|
|
6443
6443
|
headers: {
|
|
@@ -6446,7 +6446,7 @@ class MoneyLoverClient {
|
|
|
6446
6446
|
"Content-Type": "application/json",
|
|
6447
6447
|
...headers,
|
|
6448
6448
|
},
|
|
6449
|
-
body: JSON.stringify(body),
|
|
6449
|
+
body: JSON.stringify(body || {}),
|
|
6450
6450
|
});
|
|
6451
6451
|
const data = await res.json();
|
|
6452
6452
|
if (data.error != null && data.error !== 0) {
|
|
@@ -6496,6 +6496,9 @@ class MoneyLoverClient {
|
|
|
6496
6496
|
}
|
|
6497
6497
|
return false;
|
|
6498
6498
|
}
|
|
6499
|
+
getToken() {
|
|
6500
|
+
return this._jwtToken;
|
|
6501
|
+
}
|
|
6499
6502
|
getUserInfo() {
|
|
6500
6503
|
return this._postRequest("/user/info");
|
|
6501
6504
|
}
|