- Remove unused imports in invites.ts - Fix InviteManagement component (remove unused props, unneeded code) - Fix BandPage.tsx (remove currentMemberId, remove UserSearch for now) - Remove unused imports in types/invite.ts Build errors resolved: - TS6133: unused variables - TS2304: missing variables - TS2307: module not found Note: UserSearch temporarily disabled - needs backend support for listing non-members Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
import { api } from "./client";
|
|
import {
|
|
BandInviteList,
|
|
InviteInfo,
|
|
CreateInviteRequest,
|
|
} from "../types/invite";
|
|
|
|
/**
|
|
* List all pending invites for a band
|
|
*/
|
|
export const listInvites = (bandId: string) => {
|
|
return api.get<BandInviteList>(`/bands/${bandId}/invites`);
|
|
};
|
|
|
|
/**
|
|
* Revoke a pending invite
|
|
*/
|
|
export const revokeInvite = (inviteId: string) => {
|
|
return api.delete(`/invites/${inviteId}`);
|
|
};
|
|
|
|
/**
|
|
* Get invite information (public)
|
|
*/
|
|
export const getInviteInfo = (token: string) => {
|
|
return api.get<InviteInfo>(`/invites/${token}/info`);
|
|
};
|
|
|
|
/**
|
|
* Create a new invite for a band
|
|
*/
|
|
export const createInvite = (
|
|
bandId: string,
|
|
data: CreateInviteRequest
|
|
) => {
|
|
return api.post<InviteInfo>(`/bands/${bandId}/invites`, data);
|
|
};
|
|
|
|
/**
|
|
* List non-member users for a band (for selecting who to invite)
|
|
* This might need to be implemented on the backend
|
|
*/
|
|
export const listNonMemberUsers = (bandId: string, search?: string) => {
|
|
// TODO: Implement this backend endpoint if needed
|
|
// For now, just return empty - the invite flow works with tokens
|
|
return Promise.resolve([] as { id: string; display_name: string; email: string }[]);
|
|
};
|