merge main
This commit is contained in:
@@ -805,3 +805,47 @@ export async function getPrivatePortraitSelectableAssets(params: { projectId?: s
|
||||
if (params.keyword) query.set('keyword', params.keyword);
|
||||
return api.get<PrivatePortraitSelectableAssetListOut>(`/private-portrait/selectable-assets?${query.toString()}`);
|
||||
}
|
||||
|
||||
// ── Team Management APIs ──────────────────────────────
|
||||
export async function getManagedTeam(): Promise<any> {
|
||||
return api.get('/team/managed');
|
||||
}
|
||||
|
||||
export async function getTeamMembers(page = 1, pageSize = 20): Promise<any> {
|
||||
const params = new URLSearchParams();
|
||||
params.set('page', String(page));
|
||||
params.set('page_size', String(pageSize));
|
||||
return api.get(`/team/members?${params.toString()}`);
|
||||
}
|
||||
|
||||
export async function transferCredits(memberId: string, amount: number, description?: string): Promise<void> {
|
||||
await api.post(`/team/members/${memberId}/credits`, { target_user_id: memberId, amount, description: description || null });
|
||||
}
|
||||
|
||||
export async function getTeamInvitations(): Promise<any[]> {
|
||||
return api.get('/team/invitations');
|
||||
}
|
||||
|
||||
export async function createTeamInvitation(maxUses?: number, expiresAt?: string): Promise<any> {
|
||||
return api.post('/team/invitations', { max_uses: maxUses || null, expires_at: expiresAt || null });
|
||||
}
|
||||
|
||||
export async function revokeInvitation(invitationId: string): Promise<void> {
|
||||
await api.delete(`/team/invitations/${invitationId}`);
|
||||
}
|
||||
|
||||
export async function getPendingJoinRequests(): Promise<any[]> {
|
||||
return api.get('/team/join-requests');
|
||||
}
|
||||
|
||||
export async function handleJoinRequest(requestId: string, action: 'approve' | 'reject', note?: string): Promise<void> {
|
||||
await api.post(`/team/join-requests/${requestId}`, { action, note: note || null });
|
||||
}
|
||||
|
||||
export async function getJoinTeamInfo(code: string): Promise<any> {
|
||||
return api.get(`/team/join-info?code=${encodeURIComponent(code)}`);
|
||||
}
|
||||
|
||||
export async function submitJoinRequest(code: string): Promise<void> {
|
||||
await api.post('/team/join', { invitation_code: code });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user