diff --git a/frontend/src/assets/lang/app/en.json b/frontend/src/assets/lang/app/en.json index e0109448..c0eeb3c2 100644 --- a/frontend/src/assets/lang/app/en.json +++ b/frontend/src/assets/lang/app/en.json @@ -285,7 +285,13 @@ }, "edit": "Edit", "cancel": "Cancel", - "save": "Save", + "save": { + "save": "Save", + "error": { + "title": "Invalid Safe Operation", + "detail": "Trying to save while no item is selected" + } + }, "delete": "Delete", "users": { "title": "Users", diff --git a/frontend/src/assets/lang/app/nl.json b/frontend/src/assets/lang/app/nl.json index d05c4255..2471a7d3 100644 --- a/frontend/src/assets/lang/app/nl.json +++ b/frontend/src/assets/lang/app/nl.json @@ -280,7 +280,13 @@ }, "edit": "Bewerken", "cancel": "Annuleer", - "save": "Sla op", + "save": { + "save": "Sla op", + "error": { + "title": "Ongeldige Opsla Operatie", + "detail": "Men kan niet opslaan wanneer geen item is geselecteerd" + } + }, "delete": "Verwijder", "users": { "title": "Gebruikers", diff --git a/frontend/src/views/admin/UsersView.vue b/frontend/src/views/admin/UsersView.vue index ff6d154d..14e3d003 100644 --- a/frontend/src/views/admin/UsersView.vue +++ b/frontend/src/views/admin/UsersView.vue @@ -18,6 +18,7 @@ import { useStudents } from '@/composables/services/student.service.ts'; import { useAssistant } from '@/composables/services/assistant.service.ts'; import { useTeacher } from '@/composables/services/teacher.service.ts'; import { useFilter } from '@/composables/filters/filter.ts'; +import { useMessagesStore } from '@/store/messages.store.ts'; import { roles, type Role, User } from '@/types/users/User.ts'; import { getUserFilters } from '@/types/filter/Filter.ts'; @@ -25,6 +26,7 @@ import { useRoute } from 'vue-router'; /* Composable injections */ const { t } = useI18n(); +const { addErrorMessage } = useMessagesStore(); const { query } = useRoute(); const { pagination, users, getUsers, searchUsers, toggleAdmin } = useUser(); const { createStudent, deleteStudent } = useStudents(); @@ -121,7 +123,7 @@ const saveItem = async (): Promise => { // update locally await dataTable.value.fetch(); } else { - // raise error TODO + addErrorMessage(t('admin.save.error.title'), t('admin.save.error.detail')); } popupEdit.value = false; }; @@ -210,7 +212,7 @@ const saveItem = async (): Promise => {
- +