change member invite to api route, add resend invitation mail, add delete invitation, fixes ST-87

This commit is contained in:
Gregor Vostrak
2024-06-26 14:32:16 +02:00
parent 42da2c3397
commit 099926f95c
12 changed files with 207 additions and 31 deletions

View File

@@ -41,13 +41,17 @@ export const useNotificationsStore = defineStore('notifications', () => {
async function handleApiRequestNotifications<T>(
apiRequest: () => Promise<T>,
successMessage?: string,
errorMessage?: string
errorMessage?: string,
onSuccess?: (response: T) => void
) {
try {
const response = await apiRequest();
if (successMessage) {
addNotification('success', successMessage);
}
if (onSuccess) {
onSuccess(response);
}
return response;
} catch (error) {
if (axios.isAxiosError(error)) {
@@ -72,6 +76,9 @@ export const useNotificationsStore = defineStore('notifications', () => {
if (successMessage) {
addNotification('success', successMessage);
}
if (onSuccess) {
onSuccess(response);
}
return response;
} catch (error) {
router.get(route('login'));