Skip to content

Commit

Permalink
resolve post merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettladley committed Jun 12, 2024
1 parent 411a664 commit 7af7e5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
5 changes: 3 additions & 2 deletions backend/entities/events/previews/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

func GetEventPreivews(db *gorm.DB, pageInfo *fiberpaginate.PageInfo) ([]EventPreview, error) {
db = cache.SetUseCache(db, true)

var events []EventStub
if err := db.Scopes(utilities.IntoScope(*pageInfo, db)).Find(&events).Error; err != nil {
return nil, err
Expand All @@ -25,6 +25,8 @@ func GetEventPreivews(db *gorm.DB, pageInfo *fiberpaginate.PageInfo) ([]EventPre
}

func GetEventPreviewsByTime(db *gorm.DB, pageInfo *fiberpaginate.PageInfo, startTime *time.Time, endTime *time.Time) ([]EventPreview, error) {
var events []EventStub

query := cache.SetUseCache(db, true).Model(&events)

if startTime != nil && endTime != nil {
Expand All @@ -35,7 +37,6 @@ func GetEventPreviewsByTime(db *gorm.DB, pageInfo *fiberpaginate.PageInfo, start
query = query.Scopes(utilities.IntoScope(*pageInfo, db))
}

var events []EventStub
if err := query.Find(&events).Error; err != nil {
return nil, err
}
Expand Down
11 changes: 0 additions & 11 deletions backend/entities/events/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@ func GetEvents(db *gorm.DB, pageInfo fiberpaginate.PageInfo) ([]models.Event, er
return events, nil
}

func GetEvent(db *gorm.DB, eventID uuid.UUID, preloads ...transactions.OptionalQuery) (*models.Event, error) {
db = cache.SetUseCache(db, true)

var event models.Event
if err := db.Scopes(utilities.IntoScope(pageInfo, db)).Find(&events).Error; err != nil {
return nil, err
}

return events, nil
}

func GetEvent(db *gorm.DB, eventID uuid.UUID, preloads ...transactions.OptionalQuery) (*models.Event, error) {
query := cache.SetUseCache(db, true)

Expand Down

0 comments on commit 7af7e5f

Please sign in to comment.