mirror of
https://github.com/balzack/databag.git
synced 2025-04-24 02:25:26 +00:00
fixing tests
This commit is contained in:
parent
72f51d00e4
commit
b3b9688dfa
@ -4,7 +4,7 @@ export async function clearLogin(node: string, secure: boolean, token: string, a
|
||||
const param = all ? '&all=true' : ''
|
||||
const endpoint = `http${secure ? 's' : ''}://${node}/account/apps?agent=${token}${param}`;
|
||||
const response = await axios.delete(endpoint);
|
||||
if (response.status >= 400 && response.stateus < 600) {
|
||||
if (response.status >= 400 && response.status < 600) {
|
||||
throw new Error('clearLogin failed');
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import axios from 'redaxios';
|
||||
|
||||
export async function getAvailable(node: string, secure: boolean): number {
|
||||
export async function getAvailable(node: string, secure: boolean): Promise<number> {
|
||||
const endpoint = `http${secure ? 's' : ''}://${node}/account/available`;
|
||||
const response = await axios.get(endpoint);
|
||||
if (response.status >= 400 && response.status < 600) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import axios from 'redaxios';
|
||||
|
||||
export async function getUsername(name: string, token: string, node: string, secure: boolean): boolean {
|
||||
export async function getUsername(name: string, token: string, node: string, secure: boolean): Promise<boolean> {
|
||||
const param = token ? `&token=${token}` : '';
|
||||
const username = encodeURIComponent(name)
|
||||
const endpoint = `http${secure ? 's' : ''}://${node}/account/username?name=${username}${param}`;
|
||||
|
@ -9,7 +9,7 @@ export async function setLogin(node: string, secure: boolean, username: string,
|
||||
const response = await axios.post(endpoint, notifications, { auth: `Basic ${auth}` });
|
||||
return response.data;
|
||||
}
|
||||
catch(err) {
|
||||
catch(err: any) {
|
||||
throw new Error(err.status);
|
||||
}
|
||||
}
|
||||
|
7670
app/sdk/yarn.lock
7670
app/sdk/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user