|
|
@ -21,7 +21,7 @@ namespace espacecollab.backend.api.Controllers |
|
|
|
return Ok(CollaborateursServices.GetAll()); |
|
|
|
return Ok(CollaborateursServices.GetAll()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[HttpGet("{collaborateurId}")] |
|
|
|
[HttpGet("{collaborateurId:int:min(1)}")] |
|
|
|
public ActionResult<CollaborateurApiDto> GetCollaborateurById(int collaborateurId) |
|
|
|
public ActionResult<CollaborateurApiDto> GetCollaborateurById(int collaborateurId) |
|
|
|
{ |
|
|
|
{ |
|
|
|
CollaborateurApiDto? collaborateur = CollaborateursServices.GetById(collaborateurId); |
|
|
|
CollaborateurApiDto? collaborateur = CollaborateursServices.GetById(collaborateurId); |
|
|
@ -41,7 +41,7 @@ namespace espacecollab.backend.api.Controllers |
|
|
|
return Ok(addedCollaborateur); |
|
|
|
return Ok(addedCollaborateur); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[HttpDelete("delete")] |
|
|
|
[HttpDelete("delete/{collaborateurId:int:min(1)}")] |
|
|
|
public ActionResult DeleteCollaborateur(int collaborateurId) |
|
|
|
public ActionResult DeleteCollaborateur(int collaborateurId) |
|
|
|
{ |
|
|
|
{ |
|
|
|
bool isCollaborateurDeleted = CollaborateursServices.Delete(collaborateurId); |
|
|
|
bool isCollaborateurDeleted = CollaborateursServices.Delete(collaborateurId); |
|
|
@ -62,7 +62,7 @@ namespace espacecollab.backend.api.Controllers |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[HttpGet("businessunit/{businessId}")] |
|
|
|
[HttpGet("businessunit/{businessId:int:min(1)}")] |
|
|
|
public ActionResult<IEnumerable<CollaborateurApiDto>> GetCollaborateursByBusinessUnit(int businessId) |
|
|
|
public ActionResult<IEnumerable<CollaborateurApiDto>> GetCollaborateursByBusinessUnit(int businessId) |
|
|
|
{ |
|
|
|
{ |
|
|
|
IEnumerable<CollaborateurApiDto> collaborateurs = CollaborateursServices.GetCollaborateursByBusinessUnit(businessId); |
|
|
|
IEnumerable<CollaborateurApiDto> collaborateurs = CollaborateursServices.GetCollaborateursByBusinessUnit(businessId); |
|
|
@ -72,7 +72,7 @@ namespace espacecollab.backend.api.Controllers |
|
|
|
return Ok(collaborateurs); |
|
|
|
return Ok(collaborateurs); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[HttpGet("referrer/{referrerId}")] |
|
|
|
[HttpGet("referrer/{referrerId:int:min(1)}")] |
|
|
|
public ActionResult<IEnumerable<CollaborateurApiDto>> GetCollaborateursByReferrer(int referrerId) |
|
|
|
public ActionResult<IEnumerable<CollaborateurApiDto>> GetCollaborateursByReferrer(int referrerId) |
|
|
|
{ |
|
|
|
{ |
|
|
|
IEnumerable<CollaborateurApiDto> collaborateurs = CollaborateursServices.GetCollaborateursByReferrer(referrerId); |
|
|
|
IEnumerable<CollaborateurApiDto> collaborateurs = CollaborateursServices.GetCollaborateursByReferrer(referrerId); |
|
|
@ -82,7 +82,7 @@ namespace espacecollab.backend.api.Controllers |
|
|
|
return Ok(collaborateurs); |
|
|
|
return Ok(collaborateurs); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[HttpGet("apsidemail/{apsideMail}")] |
|
|
|
[HttpGet("apsidemail/{apsideMail:minlength(1):regex(^\\S.*)}")] |
|
|
|
public ActionResult<CollaborateurApiDto> GetCollaborateurByApsideMail(string apsideMail) |
|
|
|
public ActionResult<CollaborateurApiDto> GetCollaborateurByApsideMail(string apsideMail) |
|
|
|
{ |
|
|
|
{ |
|
|
|
CollaborateurApiDto? collaborateur = CollaborateursServices.GetCollaborateurByApsideMail(apsideMail); |
|
|
|
CollaborateurApiDto? collaborateur = CollaborateursServices.GetCollaborateurByApsideMail(apsideMail); |
|
|
|