File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ export class Siren {
242242 } ;
243243
244244 if ( category ) params . category = category ;
245-
245+
246246 response = await notificationsBulkUpdates (
247247 this . token ,
248248 this . recipientId ,
@@ -299,6 +299,7 @@ export class Siren {
299299
300300 if ( isRead !== undefined ) params . isRead = isRead ;
301301 if ( category ) params . category = category ;
302+
302303 response = await notificationsBulkUpdates (
303304 this . token ,
304305 this . recipientId ,
Original file line number Diff line number Diff line change @@ -12,20 +12,29 @@ const notificationsBulkUpdates = (
1212 inAppRecipientId : string ,
1313 data : {
1414 until : string ;
15- isRead ?: boolean ;
1615 operation : BulkUpdateType ;
16+ category ?: string ,
17+ isRead ?: boolean
1718 }
1819) : Promise < ActionResponse > => {
19- const path = `api/v2/in-app/recipients/${ inAppRecipientId } /notifications/bulk-update` ;
20+ let path = `api/v2/in-app/recipients/${ inAppRecipientId } /notifications/bulk-update` ;
2021
22+ const { category, isRead, ...filteredData } = data ;
23+
24+ if ( category )
25+ path = `${ path } ?category=${ category } ` ;
26+
27+ if ( isRead )
28+ path = path . includes ( '?' ) ? `${ path } &isRead=${ isRead } ` : `${ path } ?isRead=${ isRead } ` ;
29+
2130 const resp : Promise < ActionResponse > = httpPost (
2231 {
2332 path,
2433 token,
2534 errorLevel : ErrorLevelType . ERROR ,
2635 operation : operations [ data . operation ?? BulkUpdateType . MARK_AS_READ ]
2736 } ,
28- data
37+ filteredData
2938 ) ;
3039
3140 return resp ;
You can’t perform that action at this time.
0 commit comments