format code
This commit is contained in:
@@ -5,7 +5,7 @@ class Flatastic {
|
||||
this.apikey = apikey;
|
||||
}
|
||||
|
||||
async request(url: string, option: any) {
|
||||
async request(url: stringany) {
|
||||
const headers = {
|
||||
accept: "application/json, text/plain, */*",
|
||||
"accept-language":
|
||||
@@ -20,10 +20,8 @@ class Flatastic {
|
||||
"x-client-version": "2.3.20",
|
||||
};
|
||||
const response = await fetch(url, {
|
||||
...option,
|
||||
headers: {
|
||||
...headers,
|
||||
...option.headers,
|
||||
},
|
||||
});
|
||||
if (!response.ok) {
|
||||
@@ -35,19 +33,15 @@ class Flatastic {
|
||||
getShoppingList() {
|
||||
return this.request(
|
||||
"https://api.flatastic-app.com/index.php/api/shoppinglist",
|
||||
{},
|
||||
);
|
||||
}
|
||||
|
||||
getTaskList() {
|
||||
return this.request(
|
||||
"https://api.flatastic-app.com/index.php/api/chores",
|
||||
{},
|
||||
);
|
||||
return this.request("https://api.flatastic-app.com/index.php/api/chores");
|
||||
}
|
||||
|
||||
getInformation() {
|
||||
this.request("https://api.flatastic-app.com/index.php/api/wg", {});
|
||||
return this.request("https://api.flatastic-app.com/index.php/api/wg");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user