Skip to content

Commit

Permalink
fixed returning handler returning null
Browse files Browse the repository at this point in the history
  • Loading branch information
SchawnnDev committed Dec 6, 2023
1 parent 9eaabbb commit c4558c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internals/export/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func (ew *Wrapper) checkForExpiredFiles() error {
}

func (ew *Wrapper) GetUserExports(user users.User) []WrapperItem {
var result []WrapperItem
result := make([]WrapperItem, 0)

// first, gather all exports that are in the workers if there are any
for _, worker := range ew.workers {
Expand Down
7 changes: 6 additions & 1 deletion internals/handlers/notification_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ func GetNotifications(w http.ResponseWriter, r *http.Request) {
return
}

notifications = append(notifications, notification.NewMockNotification(1, "level", "title", "subTitle", "description", time.Now(), []int64{1}, map[string]interface{}{"issueId": 1}))
// generate rando mock notifications for testing 1 to 15
for i := 2; i < 17; i++ {
notifications = append(notifications, notification.NewMockNotification(int64(i), "OK", "MockNotification", "Toodododo", "You must do something lol", time.Now().AddDate(0, 0, -i), []int64{1}, map[string]interface{}{"issueId": 1}))
}

notifications = append(notifications, notification.NewMockNotification(1, "OK", "MockNotification", "Toodododo", "You must do something lol", time.Now(), []int64{1}, map[string]interface{}{"issueId": 1}))
notifications = append(notifications, notification.NewExportNotification(2, export.WrapperItem{Id: "test"}, 1))
notifications = append(notifications, notification.NewBaseNotification(3, false))
render.JSON(w, r, notifications)
Expand Down

0 comments on commit c4558c9

Please sign in to comment.