File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed
app/javascript/notifications Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -24,28 +24,17 @@ export function convert(resource) {
2424}
2525
2626export function load ( useLimit ) {
27- const promises = [ ] ;
2827 const limitFragment = useLimit ? `&limit=${ maxNotifications } ` : '' ;
2928
30- promises . push ( API . get ( `/api/notifications?expand=resources&attributes=details&sort_by=id&sort_order=desc${ limitFragment } ` )
29+ return API . get ( `/api/notifications?expand=resources&attributes=details&sort_by=id&sort_order=desc${ limitFragment } ` )
3130 . then ( ( data ) => {
3231 const notifications = data . resources . map ( convert ) ;
3332
3433 return {
3534 notifications,
36- subcount : data . subcount ,
35+ subcount : data . count
3736 } ;
38- } ) ) ;
39-
40- if ( useLimit ) {
41- // get real subcount
42- promises . push ( API . get ( '/api/notifications' ) ) ;
43- }
44-
45- return Promise . all ( promises ) . then ( ( [ { notifications, subcount } , meta ] ) => ( {
46- notifications,
47- subcount : meta ? meta . subcount : subcount ,
48- } ) ) ;
37+ } ) ;
4938}
5039
5140const bulkAction = ( action ) => ( notifications ) => API . post ( `/api/notifications/` , {
You can’t perform that action at this time.
0 commit comments