Skip to content

Commit

Permalink
emit event correctie
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHub committed Dec 31, 2024
1 parent 2d8c914 commit c6b1684
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/src/controllers/consultants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {IConsultant} from '../models/consultants';
import {CollectionNames, createAudit, SocketEventTypes, updateAudit} from '../models/common';
import {ConfacRequest} from '../models/technical';
import {saveAudit} from './utils/audit-logs';
import { emitEntityEvent } from './utils/entity-events';
import {emitEntityEvent} from './utils/entity-events';

export const getConsultants = async (req: Request, res: Response) => {
const consultants = await req.db.collection<IConsultant>(CollectionNames.CONSULTANTS).find().toArray();
Expand All @@ -22,7 +22,7 @@ export const saveConsultant = async (req: ConfacRequest, res: Response) => {

await saveAudit(req, 'consultant', originalConsultant, consultant);
const responseConsultant = {_id, ...consultant};
emitEntityEvent(SocketEventTypes.EntityUpdated, CollectionNames.CONSULTANTS, _id, responseConsultant);
emitEntityEvent(req, SocketEventTypes.EntityUpdated, CollectionNames.CONSULTANTS, _id, responseConsultant);
return res.send(responseConsultant);
}

Expand Down

0 comments on commit c6b1684

Please sign in to comment.