feat: replace back button with invite member functionality
This commit is contained in:
@@ -20,6 +20,10 @@ import type {
|
||||
BulkOperationResponse,
|
||||
User,
|
||||
OAuthUrlResponse,
|
||||
CreateInviteLinkRequest,
|
||||
InviteLinkResponse,
|
||||
ValidateInviteResponse,
|
||||
JoinFamilyResponse,
|
||||
} from '../types';
|
||||
|
||||
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || '';
|
||||
@@ -133,3 +137,20 @@ export const shoppingItemApi = {
|
||||
clearAll: (familyId: number) =>
|
||||
apiClient.delete<BulkOperationResponse>(`/families/${familyId}/shopping-items/clear-all`),
|
||||
};
|
||||
|
||||
export const inviteLinkApi = {
|
||||
create: (data: CreateInviteLinkRequest) =>
|
||||
apiClient.post<InviteLinkResponse>('/my-family/invite-links', data),
|
||||
|
||||
getMyLinks: () =>
|
||||
apiClient.get<InviteLinkResponse[]>('/my-family/invite-links'),
|
||||
|
||||
delete: (token: string) =>
|
||||
apiClient.delete(`/my-family/invite-links/${token}`),
|
||||
|
||||
validate: (token: string) =>
|
||||
apiClient.get<ValidateInviteResponse>(`/invite/${token}`),
|
||||
|
||||
join: (token: string) =>
|
||||
apiClient.post<JoinFamilyResponse>(`/invite/${token}/join`),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user