Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Foreign Key Constraint Violation in project_module_task During Project Module Creation #8776

Merged
merged 11 commits into from
Feb 17, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ export class OrganizationProjectModule extends TenantOrganizationBaseEntity impl
/**
* Task
*/
@ApiPropertyOptional({ type: () => Array, isArray: true, description: 'List of task IDs' })
@IsOptional()
@IsArray()
@MultiORMManyToMany(() => Task, (it) => it.modules, {
/** Defines the database action to perform on update. */
onUpdate: 'CASCADE',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import { CommandHandlers } from './commands/handlers';
import { OrganizationProjectModuleService } from './organization-project-module.service';
import { OrganizationProjectModuleController } from './organization-project-module.controller';
import { OrganizationProjectModule } from './organization-project-module.entity';
import { TypeOrmOrganizationProjectModuleRepository } from './repository/type-orm-organization-project-module.repository';
import { RolePermissionModule } from '../role-permission/role-permission.module';
import { RoleModule } from '../role/role.module';
import { EmployeeModule } from '../employee/employee.module';
import { TaskModule } from '../tasks/task.module';
import { OrganizationProjectModuleEmployee } from './organization-project-module-employee.entity';
import { TypeOrmOrganizationProjectModuleRepository } from './repository/type-orm-organization-project-module.repository';
import { TypeOrmOrganizationProjectModuleEmployeeRepository } from './repository/type-orm-organization-project-module-employee.repository';

@Module({
Expand All @@ -21,6 +22,7 @@ import { TypeOrmOrganizationProjectModuleEmployeeRepository } from './repository
RolePermissionModule,
RoleModule,
EmployeeModule,
TaskModule,
CqrsModule
],
controllers: [OrganizationProjectModuleController],
Expand Down
Loading
Loading