|
@ -33,8 +33,11 @@ import projectStore, { fpProjectStore } from "../stores/project"; |
|
|
let description = group.description; |
|
|
let description = group.description; |
|
|
let icon = group.icon as IconName; |
|
|
let icon = group.icon as IconName; |
|
|
let error = null; |
|
|
let error = null; |
|
|
|
|
|
let loading = false; |
|
|
|
|
|
|
|
|
function onSubmit() { |
|
|
function onSubmit() { |
|
|
|
|
|
loading = true; |
|
|
|
|
|
|
|
|
if (creation) { |
|
|
if (creation) { |
|
|
stuffLogClient.createGroup({ |
|
|
stuffLogClient.createGroup({ |
|
|
name, description, icon, |
|
|
name, description, icon, |
|
@ -43,6 +46,8 @@ import projectStore, { fpProjectStore } from "../stores/project"; |
|
|
modalStore.close(); |
|
|
modalStore.close(); |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
error = err.message ? err.message : err.toString(); |
|
|
error = err.message ? err.message : err.toString(); |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
loading = false; |
|
|
}) |
|
|
}) |
|
|
} else if (deletion) { |
|
|
} else if (deletion) { |
|
|
stuffLogClient.deleteGroup(group.id).then(() => { |
|
|
stuffLogClient.deleteGroup(group.id).then(() => { |
|
@ -50,6 +55,8 @@ import projectStore, { fpProjectStore } from "../stores/project"; |
|
|
modalStore.close(); |
|
|
modalStore.close(); |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
error = err.message ? err.message : err.toString(); |
|
|
error = err.message ? err.message : err.toString(); |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
loading = false; |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
stuffLogClient.updateGroup(group.id, { |
|
|
stuffLogClient.updateGroup(group.id, { |
|
@ -63,6 +70,8 @@ import projectStore, { fpProjectStore } from "../stores/project"; |
|
|
modalStore.close(); |
|
|
modalStore.close(); |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
error = err.message ? err.message : err.toString(); |
|
|
error = err.message ? err.message : err.toString(); |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
loading = false; |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -85,6 +94,6 @@ import projectStore, { fpProjectStore } from "../stores/project"; |
|
|
|
|
|
|
|
|
<hr /> |
|
|
<hr /> |
|
|
|
|
|
|
|
|
<button type="submit">{verb} Group</button> |
|
|
|
|
|
|
|
|
<button disabled={loading} type="submit">{verb} Group</button> |
|
|
</form> |
|
|
</form> |
|
|
</Modal> |
|
|
</Modal> |