Add /api/v1/notifications/dismiss
This commit is contained in:
parent
f51571807d
commit
345ee46682
3 changed files with 20 additions and 0 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -36,6 +37,17 @@ func (c *Client) GetNotification(ctx context.Context, id ID) (*Notification, err
|
|||
return ¬ification, nil
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
// ClearNotifications clear notifications.
|
||||
func (c *Client) ClearNotifications(ctx context.Context) error {
|
||||
return c.doAPI(ctx, http.MethodPost, "/api/v1/notifications/clear", nil, nil, nil)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue