We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fafff22 commit 51b7e75Copy full SHA for 51b7e75
src/actions/inviteToWorkspace.js
@@ -48,7 +48,9 @@ module.exports = async function inviteToWorkspace(params) {
48
if (inviterRoles == null || (!inviterRoles.includes('admin') && !inviterRoles.includes('owner'))) {
49
throw new Error('Forbidden');
50
}
51
- if (workspace.subscriptionTier !== 'pro') {
+ const users = await User.find({ _id: { $in: workspace.members.map(member => member.userId) } });
52
+ const numPaidUsers = users.filter(user => !user.isFreeUser).length;
53
+ if (workspace.subscriptionTier !== 'pro' && numPaidUsers > 0) {
54
throw new Error('Cannot invite user without creating a subscription');
55
56
0 commit comments