diff --git a/pkg/service/profile.go b/pkg/service/profile.go index cbfe5c0..e0fb473 100644 --- a/pkg/service/profile.go +++ b/pkg/service/profile.go @@ -118,9 +118,9 @@ func (s *Service) CreateProfile() http.HandlerFunc { profile *Profile `json:"profile"` } var ( - body []byte - in input - err error + body, contents []byte + in input + err error ) body, err = io.ReadAll(r.Body) @@ -136,8 +136,17 @@ func (s *Service) CreateProfile() http.HandlerFunc { return } + // serialize just the profile part + contents, err = json.Marshal(in.profile) + if err != nil { + + } + // create a new profile on disk - os.WriteFile() + err = os.WriteFile(in.path, contents, os.ModePerm) + if err != nil { + + } w.WriteHeader(http.StatusOK) }