Skip to content

Commit

Permalink
fix public event model
Browse files Browse the repository at this point in the history
  • Loading branch information
andreromao committed Apr 9, 2024
1 parent 0f34cb2 commit d683870
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions backend/src/models/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ type EventPublic struct {
// Example: index 1 corresponds to monday, index 2 to tuesday, etc).
// The themes can be "Software Engineer", "Security", "Gaming", etc.
Themes []string `json:"themes" bson:"themes"`

CalendarUrl string `json:"calendarUrl" bson:"calendarUrl"`
}

// DurationInDays returns the duration of the event in days.
Expand Down
11 changes: 6 additions & 5 deletions backend/src/mongodb/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ func (e *EventsType) GetCurrentEvent() (*models.Event, error) {
func eventToPublic(event models.Event) *models.EventPublic {

public := models.EventPublic{
ID: event.ID,
Name: event.Name,
Begin: event.Begin,
End: event.End,
Themes: event.Themes,
ID: event.ID,
Name: event.Name,
Begin: event.Begin,
End: event.End,
Themes: event.Themes,
CalendarUrl: event.CalendarUrl,
}

return &public
Expand Down

0 comments on commit d683870

Please sign in to comment.