|
|
|
@ -64,6 +64,36 @@ namespace espacecollab.backend.api.Controllers |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[HttpGet("businessunit/{businessId}")] |
|
|
|
|
public ActionResult<IEnumerable<CollaborateurApiDto>> GetCollaborateursByBusinessUnit(int businessId) |
|
|
|
|
{ |
|
|
|
|
IEnumerable<CollaborateurApiDto> collaborateurs = CollaborateursServices.GetCollaborateursByBusinessUnit(businessId); |
|
|
|
|
if (collaborateurs == null) |
|
|
|
|
return NotFound(); |
|
|
|
|
|
|
|
|
|
return Ok(collaborateurs); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[HttpGet("referrer/{referrerId}")] |
|
|
|
|
public ActionResult<IEnumerable<CollaborateurApiDto>> GetCollaborateursByReferrer(int referrerId) |
|
|
|
|
{ |
|
|
|
|
IEnumerable<CollaborateurApiDto> collaborateurs = CollaborateursServices.GetCollaborateursByReferrer(referrerId); |
|
|
|
|
if (collaborateurs == null) |
|
|
|
|
return NotFound(); |
|
|
|
|
|
|
|
|
|
return Ok(collaborateurs); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[HttpGet("apsidemail/{apsideMail}")] |
|
|
|
|
public ActionResult<CollaborateurApiDto> GetCollaborateurByApsideMail(string apsideMail) |
|
|
|
|
{ |
|
|
|
|
CollaborateurApiDto? collaborateur = CollaborateursServices.GetCollaborateurByApsideMail(apsideMail); |
|
|
|
|
if (collaborateur == null) |
|
|
|
|
return NotFound(); |
|
|
|
|
|
|
|
|
|
return Ok(collaborateur); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//public IEnumerable<CollaborateurApiDto> GetCollaborateursByBusinessUnit(int businessUnitId) |
|
|
|
|
//{ |
|
|
|
|
// return CollaborateurRepository.GetCollaborateursByBusinessUnit(businessUnitId).Select(collaborateurSql => collaborateurSql.ToApi()); |
|
|
|
|