1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 17:59:37 +02:00

Add typeOneOf filter to list notifications

This commit is contained in:
Chocobozzz 2025-02-20 11:48:04 +01:00
parent 8f35e76928
commit 0bf17d869c
No known key found for this signature in database
GPG key ID: 583A612D890159BE
11 changed files with 200 additions and 98 deletions

View file

@ -1,4 +1,4 @@
import { HttpStatusCode, ResultList, UserNotification, UserNotificationSetting } from '@peertube/peertube-models'
import { HttpStatusCode, ResultList, UserNotification, UserNotificationSetting, UserNotificationType_Type } from '@peertube/peertube-models'
import { AbstractCommand, OverrideCommandOptions } from '../shared/index.js'
export class NotificationsCommand extends AbstractCommand {
@ -23,8 +23,9 @@ export class NotificationsCommand extends AbstractCommand {
count?: number
unread?: boolean
sort?: string
typeOneOf?: UserNotificationType_Type[]
}) {
const { start, count, unread, sort = '-createdAt' } = options
const { start, count, unread, typeOneOf, sort = '-createdAt' } = options
const path = '/api/v1/users/me/notifications'
return this.getRequestBody<ResultList<UserNotification>>({
@ -35,6 +36,7 @@ export class NotificationsCommand extends AbstractCommand {
start,
count,
sort,
typeOneOf,
unread
},
implicitToken: true,