diff --git a/src/components/management/ManageTypes.vue b/src/components/management/ManageTypes.vue
index 5fec1f1..b065d25 100644
--- a/src/components/management/ManageTypes.vue
+++ b/src/components/management/ManageTypes.vue
@@ -6,7 +6,7 @@
Editere {{title}} {{ actualType.name }}
-
+
@@ -20,8 +20,8 @@
(null);
- const dialogInput = ref(null);
- const storeName = computed(() => props.type.charAt(0).toLowerCase() + props.type.slice(1) + 's')
+ const input = ref();
+ const dialogInput = ref();
+ const storeName = computed(() => props.type == 'EventType' ? 'eventTypes' : 'jobTypes')
onBeforeMount(async () => await store[`get${props.type}s`]());
- const rows = computed(() => store[storeName.value]);
+ const rows = computed(() => <(FG.EventType|FG.JobType)[]>store[storeName.value]);
const rules = [
- (s: any) => !!s || 'Darf nicht leer sein!',
+ (s: unknown) => !!s || 'Darf nicht leer sein!',
(s: string) =>
- store[storeName.value].find((e) => e.name === s) === undefined ||
+ rows.value.find((e) => e.name === s) === undefined ||
'Der Name wird bereits verwendet',
];
@@ -98,7 +97,7 @@ export default defineComponent({
];
function addType() {
- if (input.value === null || input.value.validate())
+ if (input.value === undefined || input.value.validate())
store
[`add${props.type}`](actualType.value.name)
.then(() => {
@@ -124,8 +123,8 @@ export default defineComponent({
}
function saveChanges() {
- if (dialogInput.value === null || dialogInput.value.validate())
- store[`rename${props.type}`](actualType.value.id, actualType.value.name).then(() => discardChanges());
+ if (dialogInput.value === undefined || dialogInput.value.validate())
+ void store[`rename${props.type}`](actualType.value.id, actualType.value.name).then(() => discardChanges());
}
function discardChanges() {