Update: nueva version Horux Despachos

This commit is contained in:
consultoria-as
2026-04-27 22:09:36 -06:00
commit 6b36db1403
614 changed files with 125926 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
import { apiClient } from './client';
import type { PlatformRole } from '@horux/shared';
export interface PlatformStaffUser {
id: string;
email: string;
nombre: string;
active: boolean;
tenant: { id: string; nombre: string; rfc: string } | null;
roles: PlatformRole[];
}
export interface CandidateUser {
id: string;
email: string;
nombre: string;
active: boolean;
tenant: { id: string; nombre: string; rfc: string } | null;
}
export async function listStaff(): Promise<PlatformStaffUser[]> {
const response = await apiClient.get<PlatformStaffUser[]>('/platform-staff');
return response.data;
}
export async function searchUsers(q: string): Promise<CandidateUser[]> {
const response = await apiClient.get<CandidateUser[]>('/platform-staff/search', { params: { q } });
return response.data;
}
export async function grantRole(userId: string, role: PlatformRole): Promise<void> {
await apiClient.post('/platform-staff/grant', { userId, role });
}
export async function revokeRole(userId: string, role: PlatformRole): Promise<void> {
await apiClient.post('/platform-staff/revoke', { userId, role });
}