Merge pull request 'Escalader getmembreresponse message as error if no returned membre' (#48) from fix/escalate-getmembreresponse-message-as-error into main
Reviewed-on: #48
This commit is contained in:
commit
4544940556
1 changed files with 4 additions and 0 deletions
|
@ -63,6 +63,10 @@ func (a *ApiClient) GetMembre(membreID string) (models.Membre, error) {
|
|||
}
|
||||
|
||||
if getMembreResponse.Data.Membre == *new(models.Membre) {
|
||||
if getMembreResponse.Message != "" {
|
||||
return getMembreResponse.Data.Membre, fmt.Errorf(getMembreResponse.Message)
|
||||
}
|
||||
|
||||
return getMembreResponse.Data.Membre, fmt.Errorf("Ce numéro étudiant ne correspond à aucunE membre")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue