fix: fix group list not updating when group gets edited
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { Row, Col, Input, Button, Label, Alert } from 'sveltestrap';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import Group from '../../api/group';
|
||||
import PKAPI from '../../api';
|
||||
import autosize from 'svelte-autosize';
|
||||
@@ -12,6 +13,12 @@
|
||||
|
||||
let input = new Group(group);
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
function update() {
|
||||
dispatch('update', group);
|
||||
}
|
||||
|
||||
async function submit() {
|
||||
let data = input;
|
||||
err = [];
|
||||
@@ -33,6 +40,7 @@
|
||||
let res = await api.patchGroup({token: localStorage.getItem("pk-token"), id: group.id, data: data});
|
||||
group = res;
|
||||
err = [];
|
||||
update();
|
||||
editMode = false;
|
||||
loading = false;
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user