Reorg and add services
This commit is contained in:
@@ -44,7 +44,7 @@ func (s *UserService) CreateUser(u *goff.User) error {
|
||||
}
|
||||
|
||||
func (s *UserService) DeleteUser(u *goff.User) error {
|
||||
queryString := `DELETE FROM x_users_guilds WHERE user_id = $1; DELETE FROM users WHERE id = $1`
|
||||
queryString := `DELETE CASCADE FROM x_users_guilds WHERE user_id = $1; DELETE FROM users WHERE id = $1`
|
||||
_, err := s.DB.Exec(queryString, u.ID)
|
||||
return err
|
||||
}
|
||||
@@ -72,11 +72,11 @@ func (s *UserService) RemoveUserFromGuild(u *goff.User, g *goff.Guild) error {
|
||||
|
||||
func (s *UserService) UpdateUser(u *goff.User) error {
|
||||
queryString := `UPDATE users SET
|
||||
banned = $1
|
||||
logging = $2
|
||||
steam_id = $3
|
||||
is_active = $4
|
||||
is_staff = $5
|
||||
banned = $1,
|
||||
logging = $2,
|
||||
steam_id = $3,
|
||||
is_active = $4,
|
||||
is_staff = $5,
|
||||
is_admin = $6
|
||||
WHERE id = $7`
|
||||
_, err := s.DB.Exec(queryString, u.Banned, u.Logging, u.SteamID, u.IsActive, u.IsStaff, u.IsAdmin)
|
||||
|
||||
Reference in New Issue
Block a user