mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 14:10:53 +03:00
added /config endpoint, use fewer globals (#1172)
* added /config endpoint, use fewer globals * fixed integration tests
This commit is contained in:
11
app/api.js
11
app/api.js
@@ -401,3 +401,14 @@ export function sendMetrics(blob) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
export async function getConstants() {
|
||||
const response = await fetch(getApiUrl('/config'));
|
||||
|
||||
if (response.ok) {
|
||||
const obj = await response.json();
|
||||
return obj;
|
||||
}
|
||||
|
||||
throw new Error(response.status);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user