2023-01-15 01:11:16 +01:00
|
|
|
import { ReactiveCache } from '/imports/reactiveCache';
|
|
|
|
|
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
Meteor.publish('people', async function(query, limit) {
|
2019-08-30 17:17:25 +02:00
|
|
|
check(query, Match.OneOf(Object, null));
|
2017-11-08 11:27:59 +07:00
|
|
|
check(limit, Number);
|
2018-06-12 21:13:50 +03:00
|
|
|
|
2023-03-11 19:32:16 +01:00
|
|
|
let ret = [];
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
const user = await ReactiveCache.getCurrentUser();
|
2018-06-12 21:13:50 +03:00
|
|
|
|
|
|
|
|
if (user && user.isAdmin) {
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
ret = await ReactiveCache.getUsers(query, {
|
2019-09-04 22:26:00 +03:00
|
|
|
limit,
|
|
|
|
|
sort: { createdAt: -1 },
|
|
|
|
|
fields: {
|
|
|
|
|
username: 1,
|
|
|
|
|
'profile.fullname': 1,
|
2020-12-29 15:33:14 +02:00
|
|
|
'profile.initials': 1,
|
2019-09-04 22:26:00 +03:00
|
|
|
isAdmin: 1,
|
|
|
|
|
emails: 1,
|
|
|
|
|
createdAt: 1,
|
|
|
|
|
loginDisabled: 1,
|
|
|
|
|
authenticationMethod: 1,
|
2021-01-30 02:35:29 +02:00
|
|
|
importUsernames: 1,
|
2021-06-10 16:38:28 +02:00
|
|
|
orgs: 1,
|
|
|
|
|
teams: 1,
|
2019-09-04 22:26:00 +03:00
|
|
|
},
|
2023-03-12 11:59:23 +01:00
|
|
|
},
|
|
|
|
|
true);
|
2018-06-12 21:13:50 +03:00
|
|
|
}
|
2019-08-30 17:17:25 +02:00
|
|
|
|
2023-03-11 19:32:16 +01:00
|
|
|
return ret;
|
2017-11-07 14:01:27 +07:00
|
|
|
});
|