Skip to content

Commit

Permalink
pfs-117 fixing failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholassully committed Aug 27, 2024
1 parent 4bc34e9 commit dfe6d89
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/server/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"fmt"
"github.com/opg-sirius-finance-admin/internal/api"
"github.com/opg-sirius-finance-admin/internal/model"
"github.com/opg-sirius-finance-admin/internal/util/util"
"io"
"net/http"
"os"
Expand Down Expand Up @@ -115,7 +114,7 @@ func (h *UploadHandler) handleError(w http.ResponseWriter, r *http.Request, msg
fileError := model.ValidationErrors{
"FileUpload": map[string]string{"required": msg},
}
data := AppVars{Errors: util.RenameErrors(fileError)}
data := AppVars{ValidationErrors: RenameErrors(fileError)}
w.WriteHeader(code)
return h.execute(w, r, data)
}
Expand All @@ -127,7 +126,7 @@ func (h *UploadHandler) handleUploadError(w http.ResponseWriter, r *http.Request
stErr api.StatusError
)
if errors.As(err, &valErr) {
data := AppVars{Errors: util.RenameErrors(valErr.Errors)}
data := AppVars{ValidationErrors: RenameErrors(valErr.Errors)}
w.WriteHeader(http.StatusUnprocessableEntity)
return h.execute(w, r, data)
} else if errors.As(err, &stErr) {
Expand Down

0 comments on commit dfe6d89

Please sign in to comment.