Skip to content

Commit

Permalink
♻️ More review notes refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
sfi2022 committed Oct 2, 2024
1 parent cc4018f commit f7af246
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
ref="address"
v-model="zuordnung.funktionsadresse"
label="Funktionspostfach"
hint="Welchem Gruppenpostfach gehört diese Person an?"
hint="Wie lautet das Funktionspostfach?"
placeholder="[Ändere mich]@muenchen.de"
:counter="textMaxLength"
:maxlength="textMaxLength"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
closable
:style="[
'margin-right: 1%',
validationRules.isExpiredGueltigBis(
validationRules.isExpired(
zuordnung.gueltigBis
)
? { color: 'red' }
Expand Down Expand Up @@ -157,10 +157,7 @@ import Zuordnung from "@/types/Zuordnung";
import ZuordnungService from "@/api/ZuordnungService";
import SchnittstelleRequest from "@/types/SchnittstelleRequest";
import type { VForm } from "vuetify/components";
import HealthService from "@/api/HealthService";
import { useSnackbarStore } from "@/stores/snackbar";

const snackbarStore = useSnackbarStore();
const textMaxLength = ref<number>(255);
const validationRules = useRules();
const textInputRules = [
Expand Down Expand Up @@ -234,13 +231,7 @@ function updateSchnittstelle() {
for (const zuordnung of mutableZuordnungen.value) {
if (!dialogProps.zuordnungen.includes(zuordnung)) {
zuordnung.schnittstelle = dialogProps.schnittstelle.id;
try {
await ZuordnungService.create(zuordnung);
} catch (error) {
HealthService.checkHealth().catch((error) => {
snackbarStore.showMessage(error);
});
}
await ZuordnungService.create(zuordnung);
}
}
for (const toDelete of dialogProps.zuordnungen) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function useRules() {
(value && emailPattern.test(value.trim())) || message;
}

function isExpiredGueltigBis(toDate: string | undefined) {
function isExpired(toDate: string | undefined) {
if (!toDate) {
return false;
}
Expand Down Expand Up @@ -68,7 +68,7 @@ export function useRules() {
maxLengthRule,
notEmptyRule,
isValidEmail,
isExpiredGueltigBis,
isExpired,
isGueltigAbBeforeGueltigBis,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
{{ zuordnung.funktionsadresse }}</v-col
>
</template>
Funktionspostfach
Funktionspostfach
</v-tooltip>
<v-tooltip location="top">
<template #activator="{ props }">
Expand All @@ -161,7 +161,7 @@
cols="2"
v-bind="props"
:style="[
validationRules.isExpiredGueltigBis(
validationRules.isExpired(
zuordnung.gueltigBis
)
? { color: 'red' }
Expand Down

0 comments on commit f7af246

Please sign in to comment.