feat: set timezone space level
All checks were successful
Deploy / build-and-deploy (push) Successful in 2m25s
All checks were successful
Deploy / build-and-deploy (push) Successful in 2m25s
This commit is contained in:
parent
945069052f
commit
08f6b034f5
12 changed files with 196 additions and 23 deletions
|
|
@ -22,6 +22,7 @@ type SpaceRepository interface {
|
|||
IsMember(spaceID, userID string) (bool, error)
|
||||
GetMembers(spaceID string) ([]*model.SpaceMemberWithProfile, error)
|
||||
UpdateName(spaceID, name string) error
|
||||
UpdateTimezone(spaceID, timezone string) error
|
||||
}
|
||||
|
||||
type spaceRepository struct {
|
||||
|
|
@ -128,3 +129,9 @@ func (r *spaceRepository) UpdateName(spaceID, name string) error {
|
|||
_, err := r.db.Exec(query, name, time.Now(), spaceID)
|
||||
return err
|
||||
}
|
||||
|
||||
func (r *spaceRepository) UpdateTimezone(spaceID, timezone string) error {
|
||||
query := `UPDATE spaces SET timezone = $1, updated_at = $2 WHERE id = $3;`
|
||||
_, err := r.db.Exec(query, timezone, time.Now(), spaceID)
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue