2023-01-15 01:11:16 +01:00
|
|
|
import { ReactiveCache } from '/imports/reactiveCache';
|
|
|
|
|
|
2020-12-28 21:08:27 +02:00
|
|
|
Team = new Mongo.Collection('team');
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A Team in Wekan. Organization in Trello.
|
|
|
|
|
*/
|
|
|
|
|
Team.attachSchema(
|
|
|
|
|
new SimpleSchema({
|
2021-02-11 19:07:34 +02:00
|
|
|
teamDisplayName: {
|
2020-12-28 21:08:27 +02:00
|
|
|
/**
|
|
|
|
|
* the name to display for the team
|
|
|
|
|
*/
|
|
|
|
|
type: String,
|
|
|
|
|
optional: true,
|
|
|
|
|
},
|
2021-02-11 19:07:34 +02:00
|
|
|
teamDesc: {
|
2020-12-28 21:08:27 +02:00
|
|
|
/**
|
|
|
|
|
* the description the team
|
|
|
|
|
*/
|
|
|
|
|
type: String,
|
|
|
|
|
optional: true,
|
|
|
|
|
max: 190,
|
|
|
|
|
},
|
2021-02-11 19:07:34 +02:00
|
|
|
teamShortName: {
|
2020-12-28 21:08:27 +02:00
|
|
|
/**
|
|
|
|
|
* short name of the team
|
|
|
|
|
*/
|
|
|
|
|
type: String,
|
|
|
|
|
optional: true,
|
|
|
|
|
max: 255,
|
|
|
|
|
},
|
2021-02-11 19:07:34 +02:00
|
|
|
teamWebsite: {
|
2020-12-28 21:08:27 +02:00
|
|
|
/**
|
|
|
|
|
* website of the team
|
|
|
|
|
*/
|
|
|
|
|
type: String,
|
|
|
|
|
optional: true,
|
|
|
|
|
max: 255,
|
|
|
|
|
},
|
2021-06-07 11:03:49 +02:00
|
|
|
teamIsActive: {
|
|
|
|
|
/**
|
|
|
|
|
* status of the team
|
|
|
|
|
*/
|
|
|
|
|
type: Boolean,
|
|
|
|
|
optional: true,
|
|
|
|
|
},
|
2020-12-28 21:08:27 +02:00
|
|
|
createdAt: {
|
|
|
|
|
/**
|
|
|
|
|
* creation date of the team
|
|
|
|
|
*/
|
|
|
|
|
type: Date,
|
|
|
|
|
// eslint-disable-next-line consistent-return
|
|
|
|
|
autoValue() {
|
|
|
|
|
if (this.isInsert) {
|
|
|
|
|
return new Date();
|
|
|
|
|
} else if (this.isUpsert) {
|
|
|
|
|
return { $setOnInsert: new Date() };
|
|
|
|
|
} else {
|
|
|
|
|
this.unset();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
modifiedAt: {
|
|
|
|
|
type: Date,
|
|
|
|
|
denyUpdate: false,
|
|
|
|
|
// eslint-disable-next-line consistent-return
|
|
|
|
|
autoValue() {
|
|
|
|
|
if (this.isInsert || this.isUpsert || this.isUpdate) {
|
|
|
|
|
return new Date();
|
|
|
|
|
} else {
|
|
|
|
|
this.unset();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
|
2021-02-11 19:07:34 +02:00
|
|
|
if (Meteor.isServer) {
|
2021-06-08 04:38:47 +03:00
|
|
|
Team.allow({
|
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
|
|
|
async insert(userId, doc) {
|
|
|
|
|
const user = await ReactiveCache.getUser(userId) || await ReactiveCache.getCurrentUser();
|
2023-01-15 01:11:16 +01:00
|
|
|
if (user?.isAdmin)
|
2021-06-08 04:38:47 +03:00
|
|
|
return true;
|
|
|
|
|
if (!user) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return doc._id === userId;
|
|
|
|
|
},
|
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
|
|
|
async update(userId, doc) {
|
|
|
|
|
const user = await ReactiveCache.getUser(userId) || await ReactiveCache.getCurrentUser();
|
2023-01-15 01:11:16 +01:00
|
|
|
if (user?.isAdmin)
|
2021-06-08 04:38:47 +03:00
|
|
|
return true;
|
|
|
|
|
if (!user) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return doc._id === userId;
|
|
|
|
|
},
|
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
|
|
|
async remove(userId, doc) {
|
|
|
|
|
const user = await ReactiveCache.getUser(userId) || await ReactiveCache.getCurrentUser();
|
2023-01-15 01:11:16 +01:00
|
|
|
if (user?.isAdmin)
|
2021-06-08 04:38:47 +03:00
|
|
|
return true;
|
|
|
|
|
if (!user) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return doc._id === userId;
|
|
|
|
|
},
|
|
|
|
|
fetch: [],
|
|
|
|
|
});
|
|
|
|
|
|
2021-02-11 19:07:34 +02:00
|
|
|
Meteor.methods({
|
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
|
|
|
async setCreateTeam(
|
2021-02-11 19:07:34 +02:00
|
|
|
teamDisplayName,
|
|
|
|
|
teamDesc,
|
|
|
|
|
teamShortName,
|
|
|
|
|
teamWebsite,
|
|
|
|
|
teamIsActive,
|
|
|
|
|
) {
|
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
|
|
|
if ((await ReactiveCache.getCurrentUser())?.isAdmin) {
|
2021-02-11 19:07:34 +02:00
|
|
|
check(teamDisplayName, String);
|
|
|
|
|
check(teamDesc, String);
|
|
|
|
|
check(teamShortName, String);
|
|
|
|
|
check(teamWebsite, String);
|
2021-06-07 11:03:49 +02:00
|
|
|
check(teamIsActive, Boolean);
|
2021-02-11 19:07:34 +02:00
|
|
|
|
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 nTeamNames = (await ReactiveCache.getTeams({ teamShortName })).length;
|
2021-02-11 19:07:34 +02:00
|
|
|
if (nTeamNames > 0) {
|
|
|
|
|
throw new Meteor.Error('teamname-already-taken');
|
|
|
|
|
} else {
|
|
|
|
|
Team.insert({
|
|
|
|
|
teamDisplayName,
|
|
|
|
|
teamDesc,
|
|
|
|
|
teamShortName,
|
|
|
|
|
teamWebsite,
|
|
|
|
|
teamIsActive,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
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
|
|
|
async setCreateTeamFromOidc(
|
2022-03-04 18:29:29 +01:00
|
|
|
teamDisplayName,
|
|
|
|
|
teamDesc,
|
|
|
|
|
teamShortName,
|
|
|
|
|
teamWebsite,
|
|
|
|
|
teamIsActive,
|
|
|
|
|
) {
|
|
|
|
|
check(teamDisplayName, String);
|
|
|
|
|
check(teamDesc, String);
|
|
|
|
|
check(teamShortName, String);
|
|
|
|
|
check(teamWebsite, String);
|
|
|
|
|
check(teamIsActive, Boolean);
|
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 nTeamNames = (await ReactiveCache.getTeams({ teamShortName })).length;
|
2022-03-04 18:29:29 +01:00
|
|
|
if (nTeamNames > 0) {
|
|
|
|
|
throw new Meteor.Error('teamname-already-taken');
|
|
|
|
|
} else {
|
|
|
|
|
Team.insert({
|
|
|
|
|
teamDisplayName,
|
|
|
|
|
teamDesc,
|
|
|
|
|
teamShortName,
|
|
|
|
|
teamWebsite,
|
|
|
|
|
teamIsActive,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
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
|
|
|
async setTeamDisplayName(team, teamDisplayName) {
|
|
|
|
|
if ((await ReactiveCache.getCurrentUser())?.isAdmin) {
|
2021-06-07 11:03:49 +02:00
|
|
|
check(team, Object);
|
2021-02-11 19:07:34 +02:00
|
|
|
check(teamDisplayName, String);
|
|
|
|
|
Team.update(team, {
|
|
|
|
|
$set: { teamDisplayName: teamDisplayName },
|
|
|
|
|
});
|
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
|
|
|
await Meteor.callAsync('setUsersTeamsTeamDisplayName', team._id, teamDisplayName);
|
2021-02-11 19:07:34 +02:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
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
|
|
|
async setTeamDesc(team, teamDesc) {
|
|
|
|
|
if ((await ReactiveCache.getCurrentUser())?.isAdmin) {
|
2021-06-07 11:03:49 +02:00
|
|
|
check(team, Object);
|
2021-02-11 19:07:34 +02:00
|
|
|
check(teamDesc, String);
|
|
|
|
|
Team.update(team, {
|
|
|
|
|
$set: { teamDesc: teamDesc },
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
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
|
|
|
async setTeamShortName(team, teamShortName) {
|
|
|
|
|
if ((await ReactiveCache.getCurrentUser())?.isAdmin) {
|
2021-06-07 11:03:49 +02:00
|
|
|
check(team, Object);
|
2021-02-11 19:07:34 +02:00
|
|
|
check(teamShortName, String);
|
|
|
|
|
Team.update(team, {
|
|
|
|
|
$set: { teamShortName: teamShortName },
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
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
|
|
|
async setTeamIsActive(team, teamIsActive) {
|
|
|
|
|
if ((await ReactiveCache.getCurrentUser())?.isAdmin) {
|
2021-06-07 11:03:49 +02:00
|
|
|
check(team, Object);
|
|
|
|
|
check(teamIsActive, Boolean);
|
2021-02-11 19:07:34 +02:00
|
|
|
Team.update(team, {
|
|
|
|
|
$set: { teamIsActive: teamIsActive },
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
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
|
|
|
async setTeamAllFieldsFromOidc(
|
2022-03-10 15:56:35 +01:00
|
|
|
team,
|
|
|
|
|
teamDisplayName,
|
|
|
|
|
teamDesc,
|
|
|
|
|
teamShortName,
|
|
|
|
|
teamWebsite,
|
|
|
|
|
teamIsActive,
|
|
|
|
|
) {
|
|
|
|
|
check(team, Object);
|
|
|
|
|
check(teamDisplayName, String);
|
|
|
|
|
check(teamDesc, String);
|
|
|
|
|
check(teamShortName, String);
|
|
|
|
|
check(teamWebsite, String);
|
|
|
|
|
check(teamIsActive, Boolean);
|
|
|
|
|
Team.update(team, {
|
|
|
|
|
$set: {
|
|
|
|
|
teamDisplayName: teamDisplayName,
|
|
|
|
|
teamDesc: teamDesc,
|
|
|
|
|
teamShortName: teamShortName,
|
|
|
|
|
teamWebsite: teamWebsite,
|
|
|
|
|
teamIsActive: teamIsActive,
|
|
|
|
|
},
|
|
|
|
|
});
|
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
|
|
|
await Meteor.callAsync('setUsersTeamsTeamDisplayName', team._id, teamDisplayName);
|
2022-03-10 15:56:35 +01:00
|
|
|
},
|
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
|
|
|
async setTeamAllFields(
|
2021-06-08 04:38:47 +03:00
|
|
|
team,
|
|
|
|
|
teamDisplayName,
|
|
|
|
|
teamDesc,
|
|
|
|
|
teamShortName,
|
|
|
|
|
teamWebsite,
|
|
|
|
|
teamIsActive,
|
|
|
|
|
) {
|
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
|
|
|
if ((await ReactiveCache.getCurrentUser())?.isAdmin) {
|
2021-06-07 11:03:49 +02:00
|
|
|
check(team, Object);
|
|
|
|
|
check(teamDisplayName, String);
|
|
|
|
|
check(teamDesc, String);
|
|
|
|
|
check(teamShortName, String);
|
|
|
|
|
check(teamWebsite, String);
|
|
|
|
|
check(teamIsActive, Boolean);
|
|
|
|
|
Team.update(team, {
|
2021-06-08 04:38:47 +03:00
|
|
|
$set: {
|
|
|
|
|
teamDisplayName: teamDisplayName,
|
|
|
|
|
teamDesc: teamDesc,
|
|
|
|
|
teamShortName: teamShortName,
|
|
|
|
|
teamWebsite: teamWebsite,
|
|
|
|
|
teamIsActive: teamIsActive,
|
|
|
|
|
},
|
2021-06-07 11:03:49 +02:00
|
|
|
});
|
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
|
|
|
await Meteor.callAsync('setUsersTeamsTeamDisplayName', team._id, teamDisplayName);
|
2021-06-07 11:03:49 +02:00
|
|
|
}
|
|
|
|
|
},
|
2021-02-11 19:07:34 +02:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-28 21:08:27 +02:00
|
|
|
if (Meteor.isServer) {
|
|
|
|
|
// Index for Team name.
|
2026-01-24 01:55:29 +02:00
|
|
|
Meteor.startup(async () => {
|
|
|
|
|
await Team._collection.createIndexAsync({ teamDisplayName: 1 });
|
2020-12-28 21:08:27 +02:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default Team;
|