Merge branch 'development' of https://git.aduanasoft.com/ADUANASOFT/anexo76 into fix/pediemntos-fecha-inicio
This commit is contained in:
@@ -58,6 +58,21 @@ export interface ChangePasswordRequest {
|
||||
temporary?: boolean;
|
||||
}
|
||||
|
||||
export interface InviteUserRequest {
|
||||
email: string;
|
||||
company_id: number;
|
||||
role_id: number;
|
||||
}
|
||||
|
||||
export interface InviteUserResponse {
|
||||
id: number;
|
||||
email: string;
|
||||
role: string;
|
||||
expires_at: string;
|
||||
invite_url: string;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export const usersAPI = {
|
||||
/**
|
||||
* Obtiene estadísticas de usuarios del tenant
|
||||
@@ -166,5 +181,16 @@ export const usersAPI = {
|
||||
if (response.error) {
|
||||
throw new Error(response.error);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Genera un token de invitación y envía email al usuario
|
||||
*/
|
||||
async invite(data: InviteUserRequest): Promise<InviteUserResponse> {
|
||||
const response = await api.post<InviteUserResponse>('/v1/core/invites', data);
|
||||
if (response.error) {
|
||||
throw new Error(response.error);
|
||||
}
|
||||
return response.data!;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user