This commit is contained in:
2024-08-05 17:00:39 +02:00
parent f1fb36763e
commit 96c800db05
2 changed files with 11 additions and 6 deletions

View File

@@ -85,7 +85,7 @@ func (h *RequestHandler) GetPullRequestAndReviews(org, project string, num int64
return pr.Payload, reviews.Payload, nil
}
func (h *RequestHandler) GetNotifications(since *time.Time) ([]*models.NotificationThread, error) {
func (h *RequestHandler) GetPullNotifications(since *time.Time) ([]*models.NotificationThread, error) {
if h.HasError() {
return nil, h.Error
}
@@ -95,6 +95,8 @@ func (h *RequestHandler) GetNotifications(since *time.Time) ([]*models.Notificat
params := notification.NewNotifyGetListParams().
WithDefaults().
WithSubjectType([]string{"Pull"}).
WithStatusTypes([]string{"unread"}).
WithLimit(&bigLimit)
if since != nil {
@@ -125,11 +127,12 @@ func (h *RequestHandler) SetNotificationRead(notificationId int64) error {
list, err := client.Notification.NotifyReadThread(
notification.NewNotifyReadThreadParams().
WithDefaults().
WithID(fmt.Sprint(id)),
WithID(fmt.Sprint(notificationId)),
transport.DefaultAuthentication,
)
if err != nil {
h.LogError("Error setting notification: %d: %v", notificationId, err)
h.Error = err
return err
}