Skip to content

Commit

Permalink
Added getStats
Browse files Browse the repository at this point in the history
  • Loading branch information
zigazajc007 committed Feb 13, 2022
1 parent 193a61f commit 04fdaa8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions PasskyAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,25 @@
});
}

static getStats(server){
return new Promise((resolve, reject) => {
if(!Validate.url(server)) return reject(1001);

fetch(server + "?action=getStats").then((result) => {
if (result.status != 200) return reject(1000);
return result.text();
}).then((response) => {
try{
return resolve(JSON.parse(response));
}catch(error){
return reject(1000);
}
}).catch(() => {
return reject(1000);
});
});
}

static createAccount(server, username, password, email){
return new Promise((resolve, reject) => {
if(!Validate.url(server)) return reject(1001);
Expand Down

0 comments on commit 04fdaa8

Please sign in to comment.