From 63591016b3ecd79ab1172cd98e2e830a09d6f515 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 11 Jul 2020 22:46:01 +0100 Subject: Extend Notifications API and return pinned notifications by default (#12164) * Extend notifications API and return pinned notifications in notifications list Signed-off-by: Andrew Thornton * fix swagger Signed-off-by: Andrew Thornton * Fix swagger again Signed-off-by: Andrew Thornton * fix test Signed-off-by: Andrew Thornton * remove spurious debugs * as per @6543 Signed-off-by: Andrew Thornton * Update models/notification.go * as per @6543 Signed-off-by: Andrew Thornton Co-authored-by: techknowlogick --- integrations/eventsource_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'integrations/eventsource_test.go') diff --git a/integrations/eventsource_test.go b/integrations/eventsource_test.go index bc15453147..caaf8c2cef 100644 --- a/integrations/eventsource_test.go +++ b/integrations/eventsource_test.go @@ -59,7 +59,7 @@ func TestEventSourceManagerRun(t *testing.T) { var apiNL []api.NotificationThread // -- mark notifications as read -- - req := NewRequest(t, "GET", fmt.Sprintf("/api/v1/notifications?token=%s", token)) + req := NewRequest(t, "GET", fmt.Sprintf("/api/v1/notifications?status-types=unread&token=%s", token)) resp := session.MakeRequest(t, req, http.StatusOK) DecodeJSON(t, resp, &apiNL) @@ -69,7 +69,7 @@ func TestEventSourceManagerRun(t *testing.T) { req = NewRequest(t, "PUT", fmt.Sprintf("/api/v1/repos/%s/%s/notifications?last_read_at=%s&token=%s", user2.Name, repo1.Name, lastReadAt, token)) resp = session.MakeRequest(t, req, http.StatusResetContent) - req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/notifications?token=%s", token)) + req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/notifications?token=%s&status-types=unread", token)) resp = session.MakeRequest(t, req, http.StatusOK) DecodeJSON(t, resp, &apiNL) assert.Len(t, apiNL, 1) -- cgit v1.2.3