fix more stuff
This commit is contained in:
@@ -36,8 +36,12 @@ type credentialsRequest struct {
|
||||
}
|
||||
|
||||
type profileRequest struct {
|
||||
Email string `json:"email"`
|
||||
Name string `json:"name"`
|
||||
Email string `json:"email"`
|
||||
Name string `json:"name"`
|
||||
StudioName string `json:"studioName"`
|
||||
Tagline string `json:"tagline"`
|
||||
WebsiteURL string `json:"websiteUrl"`
|
||||
InstagramURL string `json:"instagramUrl"`
|
||||
}
|
||||
|
||||
type passwordRequest struct {
|
||||
@@ -151,7 +155,7 @@ func (h *Handler) UpdateMe(c *gin.Context) {
|
||||
if !decodeJSON(c, &request) {
|
||||
return
|
||||
}
|
||||
updated, err := h.service.UpdateProfile(c.Request.Context(), user.ID, request.Email, request.Name)
|
||||
updated, err := h.service.UpdateProfile(c.Request.Context(), user.ID, request.Email, request.Name, request.StudioName, request.Tagline, request.WebsiteURL, request.InstagramURL)
|
||||
if err != nil {
|
||||
if errors.Is(err, ErrEmailTaken) {
|
||||
writeJSON(c, http.StatusConflict, map[string]string{"error": "email is already registered"})
|
||||
|
||||
Reference in New Issue
Block a user