refactor: more implementation to refactor

This commit is contained in:
David Allen 2025-08-04 15:58:02 -06:00
parent bfd83f35a3
commit ba684bd149
Signed by: towk
GPG key ID: 0430CDBE22619155

View file

@ -118,7 +118,7 @@ func (s *Service) CreateProfile() http.HandlerFunc {
profile *Profile `json:"profile"` profile *Profile `json:"profile"`
} }
var ( var (
body []byte body, contents []byte
in input in input
err error err error
) )
@ -136,8 +136,17 @@ func (s *Service) CreateProfile() http.HandlerFunc {
return return
} }
// serialize just the profile part
contents, err = json.Marshal(in.profile)
if err != nil {
}
// create a new profile on disk // create a new profile on disk
os.WriteFile() err = os.WriteFile(in.path, contents, os.ModePerm)
if err != nil {
}
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)
} }