|
|
|
@ -6,7 +6,7 @@ namespace espacecollab.backend.api.Controllers |
|
|
|
|
{ |
|
|
|
|
[Route("api/[controller]")]
|
|
|
|
|
[ApiController] |
|
|
|
|
public class CollaborateursController : ControllerBase |
|
|
|
|
public class CollaborateursController : ControllerBase |
|
|
|
|
{ |
|
|
|
|
private CollaborateursServices CollaborateursServices { get; } |
|
|
|
|
|
|
|
|
@ -15,14 +15,12 @@ namespace espacecollab.backend.api.Controllers |
|
|
|
|
CollaborateursServices = collaborateursServices; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// GET: api/collaborateurs |
|
|
|
|
[HttpGet] |
|
|
|
|
public ActionResult<IEnumerable<CollaborateurApiDto>> GetCollaborateurs() |
|
|
|
|
{ |
|
|
|
|
return Ok(CollaborateursServices.GetAll()); |
|
|
|
|
return Ok(CollaborateursServices.GetAll()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// GET: api/collaborateurs/{collaborateurId} |
|
|
|
|
[HttpGet("{collaborateurId}")] |
|
|
|
|
public ActionResult<CollaborateurApiDto> GetCollaborateurById(int collaborateurId) |
|
|
|
|
{ |
|
|
|
@ -61,7 +59,7 @@ namespace espacecollab.backend.api.Controllers |
|
|
|
|
return Problem(); |
|
|
|
|
|
|
|
|
|
return Ok(updatedCollaborateur); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[HttpGet("businessunit/{businessId}")] |
|
|
|
@ -93,22 +91,5 @@ namespace espacecollab.backend.api.Controllers |
|
|
|
|
|
|
|
|
|
return Ok(collaborateur); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//public IEnumerable<CollaborateurApiDto> GetCollaborateursByBusinessUnit(int businessUnitId) |
|
|
|
|
//{ |
|
|
|
|
// return CollaborateurRepository.GetCollaborateursByBusinessUnit(businessUnitId).Select(collaborateurSql => collaborateurSql.ToApi()); |
|
|
|
|
//} |
|
|
|
|
|
|
|
|
|
//public IEnumerable<CollaborateurApiDto> GetCollaborateursByReferrer(int referrerId) |
|
|
|
|
//{ |
|
|
|
|
// return CollaborateurRepository.GetCollaborateursByReferrer(referrerId).Select(collaborateurSql => collaborateurSql.ToApi()); |
|
|
|
|
//} |
|
|
|
|
|
|
|
|
|
//public CollaborateurApiDto? GetCollaborateurByApsideMail(string apsideMail) |
|
|
|
|
//{ |
|
|
|
|
// if (string.IsNullOrEmpty(apsideMail)) |
|
|
|
|
// return null; |
|
|
|
|
// return CollaborateurRepository.GetCollaborateurByApsideMail(apsideMail).ToApi(); |
|
|
|
|
//} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|