Skip to content

Commit

Permalink
feat: Add default values for event details
Browse files Browse the repository at this point in the history
  • Loading branch information
peterxcli committed Feb 27, 2024
1 parent 4f37b4a commit 798ad3d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkg/worker/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,18 @@ func (eth *EventTaskHandler) HandleEventTask(ctx context.Context, t *asynq.Task)
event, err := eth.eventSvc.FindByID(ctx, p.EventID)

// convert event.EventDetail to model.EventDetails, the event.EventDetail is stringed json
eventDetails := model.EventDetails{}
eventDetails := model.EventDetails{
Name: "Event Name",
Activity: "Activity",
Project: "Project",
Description: "Description",
Location: "Location",
StartTime: "Start Time",
EndTime: "End Time",
Link: "https://nckubikefestival.kktix.cc/events/17th-1",
Host: "Host",
Date: "Date",
}
err = json.Unmarshal([]byte(*event.EventDetail), &eventDetails)
if err != nil {
log.Println(err)
Expand Down

0 comments on commit 798ad3d

Please sign in to comment.