F3.1 WEB: agregar contrato de perfil personal
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
import { apiRequest } from './api';
|
||||
import type { AdministrativeUser } from './api';
|
||||
|
||||
export interface AdministrativeUserProfile extends AdministrativeUser {
|
||||
dni: string | null;
|
||||
phone: string | null;
|
||||
jobTitle: string | null;
|
||||
employeeNumber: string | null;
|
||||
}
|
||||
|
||||
export interface UserProfileInput {
|
||||
username?: string;
|
||||
email?: string | null;
|
||||
dni?: string | null;
|
||||
phone?: string | null;
|
||||
jobTitle?: string | null;
|
||||
employeeNumber?: string | null;
|
||||
firstName?: string;
|
||||
lastName?: string;
|
||||
}
|
||||
|
||||
export interface CreateUserProfileInput extends UserProfileInput {
|
||||
username: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
password: string;
|
||||
mustChangePassword: boolean;
|
||||
roleIds: string[];
|
||||
}
|
||||
|
||||
export function getUserProfile(id: string) {
|
||||
return apiRequest<AdministrativeUserProfile>(`/users/${id}`);
|
||||
}
|
||||
|
||||
export function createUserProfile(input: CreateUserProfileInput) {
|
||||
return apiRequest<AdministrativeUserProfile>('/users', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(input),
|
||||
});
|
||||
}
|
||||
|
||||
export function updateUserProfile(id: string, input: UserProfileInput) {
|
||||
return apiRequest<AdministrativeUserProfile>(`/users/${id}`, {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify(input),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user