mirror of
https://github.com/plankanban/planka.git
synced 2025-07-22 22:59:44 +02:00
Project managers, board members, auto-update after reconnection, refactoring
This commit is contained in:
parent
d6cb1f6683
commit
b39119ace4
478 changed files with 21226 additions and 19495 deletions
|
@ -1,25 +1,25 @@
|
|||
module.exports = {
|
||||
async fn(inputs, exits) {
|
||||
async fn() {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
const notifications = await sails.helpers.getNotificationsForUser(currentUser.id);
|
||||
const notifications = await sails.helpers.users.getNotifications(currentUser.id);
|
||||
|
||||
const actionIds = sails.helpers.mapRecords(notifications, 'actionId');
|
||||
const actions = await sails.helpers.getActions(actionIds);
|
||||
const actionIds = sails.helpers.utils.mapRecords(notifications, 'actionId');
|
||||
const actions = await sails.helpers.actions.getMany(actionIds);
|
||||
|
||||
const cardIds = sails.helpers.mapRecords(notifications, 'cardId');
|
||||
const cards = await sails.helpers.getCards(cardIds);
|
||||
const userIds = sails.helpers.utils.mapRecords(actions, 'userId', true);
|
||||
const users = await sails.helpers.users.getMany(userIds, true);
|
||||
|
||||
const userIds = sails.helpers.mapRecords(actions, 'userId', true);
|
||||
const users = await sails.helpers.getUsers(userIds);
|
||||
const cardIds = sails.helpers.utils.mapRecords(notifications, 'cardId');
|
||||
const cards = await sails.helpers.cards.getMany(cardIds);
|
||||
|
||||
return exits.success({
|
||||
return {
|
||||
items: notifications,
|
||||
included: {
|
||||
users,
|
||||
cards,
|
||||
actions,
|
||||
},
|
||||
});
|
||||
};
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue