mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 12:12:15 +01:00
change member invite to api route, add resend invitation mail, add delete invitation, fixes ST-87
This commit is contained in:
@@ -89,6 +89,9 @@ export type Member = MemberIndexResponse['data'][0];
|
||||
|
||||
export type UpdateMemberBody = ZodiosBodyByAlias<SolidTimeApi, 'updateMember'>;
|
||||
|
||||
export type InviteMemberBody = ZodiosBodyByAlias<SolidTimeApi, 'invite'>;
|
||||
export type MemberRole = InviteMemberBody['role'];
|
||||
|
||||
export type CreateTagBody = ZodiosBodyByAlias<SolidTimeApi, 'createTag'>;
|
||||
|
||||
export type ImportType = ZodiosResponseByAlias<
|
||||
|
||||
@@ -7,3 +7,8 @@ export function isBillingActivated() {
|
||||
|
||||
return page.props.has_billing_extension;
|
||||
}
|
||||
|
||||
export function hasActiveSubscription() {
|
||||
// TODO: Replace with server side check
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -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