diff --git a/README.md b/README.md index 21af6af..07ab506 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ func main() { * [x] GET /api/v1/mutes * [x] GET /api/v1/notifications * [x] GET /api/v1/notifications/:id -* [x] POST /api/v1/notifications/dismiss +* [x] POST /api/v1/notifications/:id/dismiss * [x] POST /api/v1/notifications/clear * [x] POST /api/v1/push/subscription * [x] GET /api/v1/push/subscription diff --git a/notification.go b/notification.go index 66f8e30..b24b9df 100644 --- a/notification.go +++ b/notification.go @@ -57,13 +57,7 @@ func (c *Client) GetNotification(ctx context.Context, id ID) (*Notification, err // DismissNotification deletes a single notification. func (c *Client) DismissNotification(ctx context.Context, id ID) error { - params := url.Values{} - params.Add("id", string(id)) - err := c.doAPI(ctx, http.MethodPost, "/api/v1/notifications/dismiss", params, nil, nil) - if err != nil { - return err - } - return nil + return c.doAPI(ctx, http.MethodPost, fmt.Sprintf("/api/v1/notifications/%v/dismiss", id), nil, nil, nil) } // ClearNotifications clear notifications. diff --git a/notification_test.go b/notification_test.go index 124a0d7..28dc975 100644 --- a/notification_test.go +++ b/notification_test.go @@ -23,7 +23,7 @@ func TestGetNotifications(t *testing.T) { case "/api/v1/notifications/clear": fmt.Fprintln(w, `{}`) return - case "/api/v1/notifications/dismiss": + case "/api/v1/notifications/123/dismiss": fmt.Fprintln(w, `{}`) return }