aboutsummaryrefslogtreecommitdiffstats
path: root/helpers
diff options
context:
space:
mode:
authorMaks Jopek <maksymilian.jopek@prym-soft.pl>2021-05-01 00:20:33 +0200
committerMaks Jopek <maksymilian.jopek@prym-soft.pl>2021-05-01 00:20:33 +0200
commitc813dfadd4b673080695ef3ade37a44e37036c07 (patch)
tree4d6348ecad8c65780323ccb823063f335c5c9e7f /helpers
parent040d5372c1033bb7c0580ad2c9b6b32f974a20c8 (diff)
downloadfia-c813dfadd4b673080695ef3ade37a44e37036c07.tar.gz
fia-c813dfadd4b673080695ef3ade37a44e37036c07.tar.zst
fia-c813dfadd4b673080695ef3ade37a44e37036c07.zip
Version 1.1
Diffstat (limited to 'helpers')
-rw-r--r--helpers/helpers.ts5
-rw-r--r--helpers/helpersBack.ts10
2 files changed, 2 insertions, 13 deletions
diff --git a/helpers/helpers.ts b/helpers/helpers.ts
index 9cd15cc..1f9aa06 100644
--- a/helpers/helpers.ts
+++ b/helpers/helpers.ts
@@ -18,15 +18,11 @@ export default class Helpers {
})
})
).json();
- // console.log(t);
- // return JSON.parse(t);
return t;
}
static dbResToFiaTable(dbRes: dbRes): fiaTable {
if (typeof dbRes.data === "string") {
- console.log("dbRes.data: ", dbRes.data);
- console.log("dbRes.data as string: ", JSON.stringify(dbRes.data));
dbRes.data = JSON.parse(dbRes.data);
}
else
@@ -40,7 +36,6 @@ export default class Helpers {
if (res.success === false) {
if (Object.keys(nRes).length === 0) {
// @ts-ignore - here error is because backend tsc is checking this file, where lib: DOM is not present
- // alert("API Error!");
throw new Error("API Error!");
} else {
nRes.status(500);
diff --git a/helpers/helpersBack.ts b/helpers/helpersBack.ts
index b0e9a6d..3d2f0a1 100644
--- a/helpers/helpersBack.ts
+++ b/helpers/helpersBack.ts
@@ -9,11 +9,6 @@ export const API_RES = {
failure: '{"success": false}',
};
export async function makeQuery(query: string, params: Array<any>): Promise<Array<any>> {
- // console.log("params are ", JSON.stringify({
- // apiKey: process.env.API_KEY,
- // query: query,
- // params: params
- // }));
let t: any = await (
await fetch("https://jopek.eu/maks/szkola/apkKli/fiaFiles/fia.php", {
method: "POST",
@@ -47,7 +42,6 @@ export async function getData(gid: number): Promise<Data> {
data = JSON.parse(data) as Data;
return data;
} else {
- console.log(data);
throw new Error("Data is not a object");
}
}
@@ -125,7 +119,7 @@ export interface OldTd {
}
export interface Chequer {
color: tColors;
- ghost?: Ghost; // number; // 1 | 2 | 3 | 4 | 5 | 6;
+ ghost?: Ghost;
};
export interface Coordinates {
x: number; //0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;
@@ -137,7 +131,7 @@ export interface Square extends Coordinates {
}
export interface HoBSquare extends Coordinates {
chequer: tColors;
- ghost?: Ghost; // number; // 1 | 2 | 3 | 4 | 5 | 6;
+ ghost?: Ghost;
}
export interface HomesOrBases {
0: Array<HoBSquare>;