Skip to content

Conversation

hentrymartin
Copy link
Collaborator

What's in this PR?

  • Email template while inviting copilot

Ticket link - https://topcoder.atlassian.net/browse/PM-1168

@@ -992,7 +992,7 @@ module.exports = (app, logger) => {
/*
Send event for Notification Service
*/
const projectId = _.parseInt(req.params.projectId);
const projectId = resource.projectId;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from _.parseInt(req.params.projectId) to resource.projectId assumes that resource.projectId is already an integer. Ensure that resource.projectId is validated or converted to an integer if necessary to prevent potential type issues.

@@ -1,13 +1,11 @@
import _ from 'lodash';
import validate from 'express-validation';
import Joi from 'joi';
import config from 'config';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import statement for 'config' has been removed. Ensure that this removal is intentional and that 'config' is not needed elsewhere in the code.


import models from '../../models';
import util from '../../util';
import { PERMISSION } from '../../permissions/constants';
import { createEvent } from '../../services/busApi';
import { CONNECT_NOTIFICATION_EVENT, COPILOT_APPLICATION_STATUS, COPILOT_OPPORTUNITY_STATUS, COPILOT_REQUEST_STATUS, EVENT, INVITE_STATUS, PROJECT_MEMBER_ROLE, RESOURCES } from '../../constants';
import { COPILOT_APPLICATION_STATUS, COPILOT_OPPORTUNITY_STATUS, COPILOT_REQUEST_STATUS, EVENT, INVITE_STATUS, PROJECT_MEMBER_ROLE, RESOURCES } from '../../constants';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import for 'CONNECT_NOTIFICATION_EVENT' and 'createEvent' has been removed. Verify that these are not used in the code and that their removal does not affect functionality.

@@ -98,16 +89,12 @@ module.exports = [
throw err;
}

const applicationUser = await util.getMemberDetailsByUserIds([userId], req.log, req.id);
req.log.info(applicationUser, 'applicationUser asdsd', userId);

const invite = await models.ProjectMemberInvite.create({

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The invite object creation is missing the email field, which was removed. Ensure that the email is being set correctly elsewhere if needed for the invitation process.

@hentrymartin hentrymartin merged commit d9d9cd4 into develop May 27, 2025
1 check passed
@hentrymartin hentrymartin deleted the pm-1168_2 branch May 27, 2025 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant