always use template strings instead of string concatenation

This commit is contained in:
zadam
2022-12-21 15:19:05 +01:00
parent ea006993f6
commit 1b24276a4a
154 changed files with 433 additions and 437 deletions

View File

@@ -72,14 +72,14 @@ async function call(method, url, data, headers = {}) {
reqRejects[requestId] = reject;
if (REQUEST_LOGGING_ENABLED) {
console.log(utils.now(), "Request #" + requestId + " to " + method + " " + url);
console.log(utils.now(), `Request #${requestId} to ${method} ${url}`);
}
ipc.send('server-request', {
requestId: requestId,
headers: headers,
method: method,
url: "/" + baseApiUrl + url,
url: `/${baseApiUrl}${url}`,
data: data
});
});
@@ -117,7 +117,7 @@ async function reportError(method, url, statusCode, response) {
toastService.showError(response.message);
throw new ValidationError(response);
} else {
const message = "Error when calling " + method + " " + url + ": " + statusCode + " - " + response;
const message = `Error when calling ${method} ${url}: ${statusCode} - ${response}`;
toastService.showError(message);
toastService.throwError(message);
}
@@ -169,7 +169,7 @@ if (utils.isElectron()) {
ipc.on('server-response', async (event, arg) => {
if (REQUEST_LOGGING_ENABLED) {
console.log(utils.now(), "Response #" + arg.requestId + ": " + arg.statusCode);
console.log(utils.now(), `Response #${arg.requestId}: ${arg.statusCode}`);
}
if (arg.statusCode >= 200 && arg.statusCode < 300) {