mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 20:22:15 +01:00
change member invite to api route, add resend invitation mail, add delete invitation, fixes ST-87
This commit is contained in:
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user