Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update events #104

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion internal/modules/cafe.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ func (c CafeHandler) GetComments(ctx context.Context, cafeID int32, counter int)
return commentsWithNames, err
}

func (c CafeHandler) CreateEvent(ctx context.Context, event models.Event) (int32, error) {
func (c CafeHandler) CreateEvent(ctx context.Context, event models.Event) (int32, error) {
start_time := event.StartTime.UTC()
end_time := event.EndTime.UTC()

Expand Down Expand Up @@ -660,6 +660,17 @@ func (c CafeHandler) Home(ctx context.Context) ([]models.Cafe, []*models.Comment
continue
}
event[i].CafeName = ds[0].Name

images, err := c.ImageRepo.GetByReferenceID(ctx, event[i].ID)
if err != nil {
log.GetLog().Errorf("Unable to get images by event id. error: %v", err)
continue
}

if images != nil {
event[i].ImageID = images[0].ID
}

}

return ds, comments, event, nil
Expand Down
Loading