mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 13:14:58 +05:00
fix checkjar getting wrong jar
This commit is contained in:
parent
7811127db6
commit
4af141772a
1 changed files with 3 additions and 3 deletions
|
@ -42,15 +42,15 @@ class Checkjar extends BaseCommand {
|
||||||
const clientInfo = await fetch("https://api.monobank.ua/personal/client-info", {
|
const clientInfo = await fetch("https://api.monobank.ua/personal/client-info", {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
"X-Token": client.config.apiKeys.monobankApiKey,
|
"X-Token": client.config.apiKeys.monobank.key,
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
}).then(res => res.json());
|
}).then(res => res.json());
|
||||||
const jar = clientInfo.jars[1];
|
const jar = clientInfo.jars.find(j => j.id === client.config.apiKeys.monobank.jar);
|
||||||
const jarTransactions = await fetch(`https://api.monobank.ua/personal/statement/${jar.id}/${Date.now() - 7 * 24 * 60 * 60 * 1000}/${Date.now()}`, {
|
const jarTransactions = await fetch(`https://api.monobank.ua/personal/statement/${jar.id}/${Date.now() - 7 * 24 * 60 * 60 * 1000}/${Date.now()}`, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
"X-Token": client.config.apiKeys.monobankApiKey,
|
"X-Token": client.config.apiKeys.monobank.key,
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
}).then(res => res.json());
|
}).then(res => res.json());
|
||||||
|
|
Loading…
Reference in a new issue