Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
Disallow updating event organizer
Browse files Browse the repository at this point in the history
It does not make sense to update the organizer. It is up to EWS app to
handle the service user changes.

This fixes being unable to cancel the meeting from Eliona after updating
times in Outlook for bookings not made by Exchange users.
  • Loading branch information
zdevaty committed May 15, 2024
1 parent 2037cb1 commit b0584d2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func UpsertEvent(ctx context.Context, assetIDs []int32, organizer string, startT

var dbEvent *appdb.Event
if eventID != 0 {
dbEvent, err = updateEvent(ctx, tx, eventID, organizer, startTime, endTime)
dbEvent, err = updateEvent(ctx, tx, eventID, startTime, endTime)
} else {
dbEvent, err = insertEvent(ctx, tx, organizer, startTime, endTime)
}
Expand Down Expand Up @@ -124,17 +124,15 @@ func insertEvent(ctx context.Context, tx *sql.Tx, organizer string, startTime, e
return dbEvent, nil
}

func updateEvent(ctx context.Context, tx *sql.Tx, eventID int64, organizer string, startTime, endTime time.Time) (*appdb.Event, error) {
func updateEvent(ctx context.Context, tx *sql.Tx, eventID int64, startTime, endTime time.Time) (*appdb.Event, error) {
dbEvent, err := appdb.FindEvent(ctx, tx, eventID)
if err != nil {
return nil, fmt.Errorf("finding event: %v", err)
}
dbEvent.Organizer = organizer
dbEvent.StartTime = startTime
dbEvent.EndTime = endTime

if _, err := dbEvent.Update(ctx, tx, boil.Whitelist(
appdb.EventColumns.Organizer,
appdb.EventColumns.StartTime,
appdb.EventColumns.EndTime,
)); err != nil {
Expand Down

0 comments on commit b0584d2

Please sign in to comment.