Skip to content

Commit

Permalink
enhence login toast for error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
scammo committed Apr 21, 2024
1 parent 355fcde commit 6241cbc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/views/Login.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<script setup>
import InputText from "primevue/inputtext";
import Button from "primevue/button";
import Toast from 'primevue/toast';
import { ref } from "vue";
import { useRouter } from "vue-router";
import { client, setLogin } from "../lib/api";
import { useToast } from 'primevue/usetoast';
const toast = useToast();
const router = useRouter();
const loading = ref(false);
Expand All @@ -25,13 +27,15 @@ const onSubmit = async () => {
router.push('/orga')
} catch (error) {
console.error(error)
toast.add({ severity: 'error', summary: 'Login war nicht erfolgreich', life: 6000 });
}
loading.value = false;
};
</script>
<template>
<main>
<Toast />
<div class="">
<div class="">
<h1>Login</h1>
Expand Down

0 comments on commit 6241cbc

Please sign in to comment.