fix(location-events): adding location id to the database from agent call

This commit is contained in:
2025-04-17 15:32:50 +01:00
parent 8e73ad6f4e
commit 7002b05aae
2 changed files with 11 additions and 4 deletions

View File

@@ -31,8 +31,8 @@ func (m EventModel) List(ctx context.Context, userId uuid.UUID) ([]model.Events,
func (m EventModel) Save(ctx context.Context, userId uuid.UUID, event model.Events) (model.Events, error) {
// TODO tx here
insertEventStmt := Events.
INSERT(Events.Name, Events.Description, Events.StartDateTime, Events.EndDateTime).
VALUES(event.Name, event.Description, event.StartDateTime, event.EndDateTime).
INSERT(Events.Name, Events.Description, Events.StartDateTime, Events.EndDateTime, Events.LocationID).
VALUES(event.Name, event.Description, event.StartDateTime, event.EndDateTime, event.LocationID).
RETURNING(Events.AllColumns)
insertedEvent := model.Events{}