Skip to content

Commit

Permalink
feat: deleting performance group
Browse files Browse the repository at this point in the history
  • Loading branch information
1grzyb1 committed Jul 1, 2023
1 parent da78e32 commit 5d02b47
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion odyseja-ui/src/routes/panel/timetable/Performance.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,6 @@
<button
type="button"
class="btn btn-md variant-filled-error ml-4"
on:click={deletePerf}> Usuń
on:click={deletePerf}>Usuń
</button>
</form>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import type {PerformanceGroup} from '../types';
import {savePerformance} from '../apiService';
import { deletePerformance, savePerformance } from '../apiService';
export let performanceGroup: PerformanceGroup;
export let onSave;
Expand All @@ -17,6 +17,13 @@
}
onSave();
}
async function deletePerf() {
for (let performance of performanceGroup.performances) {
await deletePerformance(performance.id);
}
onSave();
}
</script>

<form class="space-y-1.5">
Expand Down Expand Up @@ -87,4 +94,10 @@
class="btn btn-md variant-filled-primary"
on:click={save}>Zapisz
</button>

<button
type="button"
class="btn btn-md variant-filled-error ml-4"
on:click={deletePerf}>Usuń
</button>
</form>

0 comments on commit 5d02b47

Please sign in to comment.