Only pass State struct pointer to StateOpen, not entire response
This commit is contained in:
parent
44143c0c2d
commit
70b2e8069b
3 changed files with 10 additions and 8 deletions
|
@ -13,7 +13,7 @@ import (
|
|||
|
||||
func StateOpen(
|
||||
authDB config.HTTPBACredentials, validCredentials []config.HTTPBACredentialID,
|
||||
resp *types.SpaceAPIResponseV14,
|
||||
resp *types.SpaceState,
|
||||
) func(http.ResponseWriter, *http.Request) {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
body := updateEndpointValidator(authDB, validCredentials, w, r)
|
||||
|
@ -28,8 +28,8 @@ func StateOpen(
|
|||
}
|
||||
|
||||
// Set SpaceAPI response values
|
||||
resp.State.Open = newState
|
||||
resp.State.LastChange = time.Now().Unix()
|
||||
resp.Open = newState
|
||||
resp.LastChange = time.Now().Unix()
|
||||
|
||||
// Respond with OK
|
||||
w.WriteHeader(http.StatusOK)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue