feat(events): adding start and end times

This commit is contained in:
2025-03-31 17:32:55 +00:00
parent 59737ca9ac
commit 13e82334ca
4 changed files with 41 additions and 18 deletions

View File

@@ -17,8 +17,8 @@ type EventModel struct {
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).
VALUES(event.Name, event.Description).
INSERT(Events.Name, Events.Description, Events.StartDateTime, Events.EndDateTime).
VALUES(event.Name, event.Description, event.StartDateTime, event.EndDateTime).
RETURNING(Events.AllColumns)
insertedEvent := model.Events{}

View File

@@ -31,8 +31,8 @@ func (m LocationModel) List(ctx context.Context, userId uuid.UUID) ([]model.Loca
func (m LocationModel) Save(ctx context.Context, userId uuid.UUID, location model.Locations) (model.Locations, error) {
insertLocationStmt := Locations.
INSERT(Locations.Name, Locations.Address, Locations.Coordinates, Locations.Description).
VALUES(location.Name, location.Address, location.Coordinates, location.Description).
INSERT(Locations.Name, Locations.Address, Locations.Description).
VALUES(location.Name, location.Address, location.Description).
RETURNING(Locations.AllColumns)
insertedLocation := model.Locations{}