wip
This commit is contained in:
parent
b5ce0124a0
commit
3601fc81e8
|
@ -38,14 +38,20 @@
|
||||||
|
|
||||||
function updateWord() {
|
function updateWord() {
|
||||||
try {
|
try {
|
||||||
axios.patch("words/" + id + "/", { word: word });
|
axios.patch("words/" + id + "/", { word: word }).then(() => {
|
||||||
|
isEditWord = false;
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function updateDefinition() {
|
function updateDefinition() {
|
||||||
try {
|
try {
|
||||||
axios.patch("words/" + id + "/", { definition: definition });
|
axios
|
||||||
|
.patch("words/" + id + "/", { definition: definition })
|
||||||
|
.then(() => {
|
||||||
|
isEditDefinition = false;
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,17 +137,20 @@
|
||||||
on:change={handleChange}
|
on:change={handleChange}
|
||||||
bind:value={$form.level}
|
bind:value={$form.level}
|
||||||
class="p-1 rounded-md border"
|
class="p-1 rounded-md border"
|
||||||
required
|
|
||||||
>
|
>
|
||||||
{#await promiseLevels}<option>…</option>
|
{#await promiseLevels then}
|
||||||
{:then}
|
{#each levels as level, i}
|
||||||
{#each levels as level}
|
<option value={level.levelNumber}>
|
||||||
<option value={level.levelNumber}
|
{level.levelString}</option
|
||||||
>{level.levelString}</option
|
|
||||||
>
|
>
|
||||||
{/each}
|
{/each}
|
||||||
{/await}
|
{/await}
|
||||||
</select>
|
</select>
|
||||||
|
{#if $errors.level}
|
||||||
|
<div class="text-red-500 text-sm">
|
||||||
|
{$errors.level}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
</td>
|
</td>
|
||||||
<td class="p-2">
|
<td class="p-2">
|
||||||
<input
|
<input
|
||||||
|
@ -156,7 +159,6 @@
|
||||||
on:change={handleChange}
|
on:change={handleChange}
|
||||||
bind:value={$form.word}
|
bind:value={$form.word}
|
||||||
class="p-1 rounded-md border w-full"
|
class="p-1 rounded-md border w-full"
|
||||||
required
|
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td class="p-2">
|
<td class="p-2">
|
||||||
|
@ -166,7 +168,6 @@
|
||||||
on:change={handleChange}
|
on:change={handleChange}
|
||||||
bind:value={$form.definition}
|
bind:value={$form.definition}
|
||||||
class="p-1 rounded-md border w-full"
|
class="p-1 rounded-md border w-full"
|
||||||
required
|
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td class="p-2">
|
<td class="p-2">
|
||||||
|
|
Loading…
Reference in a new issue