Add button to delete tracks and gongs
This commit is contained in:
parent
e9a906fbfb
commit
46e8d1a1d2
@ -1,15 +1,25 @@
|
||||
<script>
|
||||
import { goto } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
|
||||
import {
|
||||
Container,
|
||||
Input,
|
||||
Icon,
|
||||
ListGroup,
|
||||
ListGroupItem,
|
||||
Spinner,
|
||||
} from 'sveltestrap';
|
||||
|
||||
import { getGong } from '$lib/gong';
|
||||
import { gongs } from '$lib/stores/gongs';
|
||||
|
||||
function deleteThis(gong) {
|
||||
gong.delete().then(() => {
|
||||
gongs.refresh();
|
||||
goto('musiks/gongs/');
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
{#await getGong($page.params.gid)}
|
||||
@ -35,5 +45,17 @@
|
||||
<span class="text-muted">{gong.id}</span>
|
||||
</ListGroupItem>
|
||||
</ListGroup>
|
||||
|
||||
<ListGroup class="my-2 text-center">
|
||||
<ListGroupItem
|
||||
action
|
||||
tag="button"
|
||||
class="text-danger fw-bold"
|
||||
on:click={() => deleteThis(gong)}
|
||||
>
|
||||
<Icon name="trash" />
|
||||
Supprimer ce gong
|
||||
</ListGroupItem>
|
||||
</ListGroup>
|
||||
</Container>
|
||||
{/await}
|
||||
|
@ -12,6 +12,14 @@
|
||||
} from 'sveltestrap';
|
||||
|
||||
import { getTrack } from '$lib/track';
|
||||
import { tracks } from '$lib/stores/tracks';
|
||||
|
||||
function deleteThis(track) {
|
||||
track.delete().then(() => {
|
||||
tracks.refresh();
|
||||
goto('musiks/tracks/');
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
{#await getTrack($page.params.tid)}
|
||||
@ -37,5 +45,17 @@
|
||||
<span class="text-muted">{track.id}</span>
|
||||
</ListGroupItem>
|
||||
</ListGroup>
|
||||
|
||||
<ListGroup class="my-2 text-center">
|
||||
<ListGroupItem
|
||||
action
|
||||
tag="button"
|
||||
class="text-danger fw-bold"
|
||||
on:click={() => deleteThis(track)}
|
||||
>
|
||||
<Icon name="trash" />
|
||||
Supprimer cette piste
|
||||
</ListGroupItem>
|
||||
</ListGroup>
|
||||
</Container>
|
||||
{/await}
|
||||
|
Loading…
x
Reference in New Issue
Block a user