mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-06 05:47:53 +00:00
feat(dashboard): reset new member/group input after submit
This commit is contained in:
parent
f14fee9ae1
commit
30f3dcf031
2 changed files with 5 additions and 4 deletions
|
|
@ -30,7 +30,7 @@
|
|||
dispatch('create', input);
|
||||
}
|
||||
|
||||
let input: Group = defaultGroup;
|
||||
let input: Group = JSON.parse(JSON.stringify(defaultGroup));
|
||||
|
||||
async function submit() {
|
||||
let data = input;
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
loading = true;
|
||||
try {
|
||||
let res = await api().groups().post({data});
|
||||
input = res;
|
||||
input = JSON.parse(JSON.stringify(defaultGroup));
|
||||
err = [];
|
||||
create();
|
||||
message = `Group ${data.name} successfully created!`
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@
|
|||
]
|
||||
};
|
||||
|
||||
let input: Member = defaultMember;
|
||||
// creating a deep copy here so that defaultMember doesn't get updated too
|
||||
let input: Member = JSON.parse(JSON.stringify(defaultMember));
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
|
|
@ -91,7 +92,7 @@
|
|||
input = res;
|
||||
err = [];
|
||||
create();
|
||||
input = defaultMember;
|
||||
input = JSON.parse(JSON.stringify(defaultMember));;
|
||||
message = `Member ${data.name} successfully created!`
|
||||
loading = false;
|
||||
} catch (error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue