diff --git a/internals/export/wrapper.go b/internals/export/wrapper.go index 01f5e8d2..5e474ed3 100644 --- a/internals/export/wrapper.go +++ b/internals/export/wrapper.go @@ -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 { diff --git a/internals/handlers/notification_handlers.go b/internals/handlers/notification_handlers.go index 3edcbe11..89730b01 100644 --- a/internals/handlers/notification_handlers.go +++ b/internals/handlers/notification_handlers.go @@ -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)