Replaced string concatenations with ES6 template literals.

This commit is contained in:
2023-03-25 07:39:18 +08:00
parent bf2c7bb785
commit 73f5d63f44
10 changed files with 148 additions and 150 deletions

View File

@ -128,7 +128,7 @@ class CurrencyForm {
}
const original = this.#code.dataset.original;
if (original === "" || this.#code.value !== original) {
const response = await fetch(this.#code.dataset.existsUrl + "?q=" + encodeURIComponent(this.#code.value));
const response = await fetch(`${this.#code.dataset.existsUrl}?q=${encodeURIComponent(this.#code.value)}`);
const data = await response.json();
if (data["exists"]) {
this.#code.classList.add("is-invalid");