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