API to receive an email address and set it (#2095)

* Generate swagger code for new endpoints
* Implemetn swagger APIs
* Add unit tests
This commit is contained in:
Javier Adriel
2022-06-09 18:13:46 -05:00
committed by GitHub
parent 5a8e029005
commit c509e5db70
25 changed files with 2400 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ var (
ErrDefault = errors.New("an error occurred, please try again")
ErrInvalidLogin = errors.New("invalid Login")
ErrForbidden = errors.New("403 Forbidden")
ErrBadRequest = errors.New("400 Bad Request")
ErrFileTooLarge = errors.New("413 File too Large")
ErrInvalidSession = errors.New("invalid session")
ErrNotFound = errors.New("not found")
@@ -81,6 +82,9 @@ func ErrorWithContext(ctx context.Context, err ...interface{}) *models.Error {
if err1.Error() == ErrForbidden.Error() {
errorCode = 403
}
if err1.Error() == ErrBadRequest.Error() {
errorCode = 400
}
if err1 == ErrNotFound {
errorCode = 404
errorMessage = ErrNotFound.Error()