fix(backend): return JSON when deleting member or user

This commit is contained in:
Sam 2023-03-13 17:10:54 +01:00
parent 62b2e3ca0d
commit 8d208ff7cd
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
3 changed files with 4 additions and 4 deletions

View file

@ -84,7 +84,7 @@ func (s *Server) discordCallback(w http.ResponseWriter, r *http.Request) error {
// TODO: implement user + token permissions // TODO: implement user + token permissions
tokenID := xid.New() tokenID := xid.New()
token, err := s.Auth.CreateToken(u.ID, tokenID, false, true, true) token, err := s.Auth.CreateToken(u.ID, tokenID, false, false, true)
if err != nil { if err != nil {
return err return err
} }
@ -222,7 +222,7 @@ func (s *Server) discordSignup(w http.ResponseWriter, r *http.Request) error {
// create token // create token
// TODO: implement user + token permissions // TODO: implement user + token permissions
tokenID := xid.New() tokenID := xid.New()
token, err := s.Auth.CreateToken(u.ID, tokenID, false, true, true) token, err := s.Auth.CreateToken(u.ID, tokenID, false, false, true)
if err != nil { if err != nil {
return errors.Wrap(err, "creating token") return errors.Wrap(err, "creating token")
} }

View file

@ -47,6 +47,6 @@ func (s *Server) deleteMember(w http.ResponseWriter, r *http.Request) error {
} }
} }
render.NoContent(w, r) render.JSON(w, r, map[string]any{"deleted": true})
return nil return nil
} }

View file

@ -37,6 +37,6 @@ func (s *Server) deleteUser(w http.ResponseWriter, r *http.Request) error {
return errors.Wrap(err, "committing transaction") return errors.Wrap(err, "committing transaction")
} }
render.NoContent(w, r) render.JSON(w, r, map[string]any{"deleted": true})
return nil return nil
} }