feat: Add setting to allow users to send invites (#6488)
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
||||
AllowNull,
|
||||
AfterUpdate,
|
||||
BeforeUpdate,
|
||||
BeforeCreate,
|
||||
} from "sequelize-typescript";
|
||||
import { TeamPreferenceDefaults } from "@shared/constants";
|
||||
import {
|
||||
@@ -347,6 +348,14 @@ class Team extends ParanoidModel<
|
||||
|
||||
// hooks
|
||||
|
||||
@BeforeCreate
|
||||
static async setPreferences(model: Team) {
|
||||
// Set here rather than in TeamPreferenceDefaults as we only want to enable by default for new
|
||||
// workspaces.
|
||||
model.setPreference(TeamPreference.MembersCanInvite, true);
|
||||
return model;
|
||||
}
|
||||
|
||||
@BeforeUpdate
|
||||
static async checkDomain(model: Team, options: SaveOptions) {
|
||||
if (!model.domain) {
|
||||
|
||||
Reference in New Issue
Block a user