Skip to content

Commit

Permalink
Fix message participant assignation bug (#8857)
Browse files Browse the repository at this point in the history
Closes #8846
  • Loading branch information
bosiraphael authored Dec 3, 2024
1 parent 2fc247c commit 743169a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';

import { FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
import { ScopedWorkspaceContextFactory } from 'src/engine/twenty-orm/factories/scoped-workspace-context.factory';
import { MatchParticipantService } from 'src/modules/match-participant/match-participant.service';

@Module({
imports: [TypeOrmModule.forFeature([FieldMetadataEntity], 'metadata')],
imports: [],
providers: [ScopedWorkspaceContextFactory, MatchParticipantService],
exports: [MatchParticipantService],
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';

import { Any, EntityManager, Repository } from 'typeorm';
import { Any, EntityManager, Equal } from 'typeorm';

import { FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
import { ScopedWorkspaceContextFactory } from 'src/engine/twenty-orm/factories/scoped-workspace-context.factory';
import { TwentyORMManager } from 'src/engine/twenty-orm/twenty-orm.manager';
import { WorkspaceEventEmitter } from 'src/engine/workspace-event-emitter/workspace-event-emitter';
Expand All @@ -22,8 +20,6 @@ export class MatchParticipantService<
private readonly workspaceEventEmitter: WorkspaceEventEmitter,
private readonly twentyORMManager: TwentyORMManager,
private readonly scopedWorkspaceContextFactory: ScopedWorkspaceContextFactory,
@InjectRepository(FieldMetadataEntity, 'metadata')
private readonly fieldMetadataRepository: Repository<FieldMetadataEntity>,
) {}

private async getParticipantRepository(
Expand Down Expand Up @@ -148,7 +144,7 @@ export class MatchParticipantService<

const participantsToUpdate = await participantRepository.find({
where: {
handle,
handle: Equal(handle),
},
});

Expand Down Expand Up @@ -214,7 +210,7 @@ export class MatchParticipantService<
if (personId) {
await participantRepository.update(
{
handle,
handle: Equal(handle),
},
{
person: null,
Expand All @@ -224,7 +220,7 @@ export class MatchParticipantService<
if (workspaceMemberId) {
await participantRepository.update(
{
handle,
handle: Equal(handle),
},
{
workspaceMember: null,
Expand Down

0 comments on commit 743169a

Please sign in to comment.