Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Secondary lead publi bug (#75)
Browse files Browse the repository at this point in the history
* fixed public cloud issue with undefined sec tech lead

* fixed public cloud issue with undefined sec tech lead

* console.logs removed
  • Loading branch information
Kolezhanchik committed Sep 8, 2023
1 parent e57f624 commit 0865eb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/natsPubSub/publicCloud/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function message(
requestedProject: PublicCloudRequestedProject,
currentProject?: PublicCloudProject
) {
return {
return{
project_set_info: {
licence_plate: requestedProject.licencePlate,
ministry_name : requestedProject.ministry,
Expand Down Expand Up @@ -107,7 +107,7 @@ function message(
name: `${requestedProject?.secondaryTechnicalLead?.firstName} ${requestedProject?.secondaryTechnicalLead?.lastName}`,
email: requestedProject?.secondaryTechnicalLead?.email,
},
].filter((techLead) => techLead.email !== null),
].filter((techLead) => techLead.email !== undefined),
current_tech_leads: !currentProject
? null
: [
Expand All @@ -119,7 +119,7 @@ function message(
name: `${currentProject?.secondaryTechnicalLead?.firstName} ${currentProject?.secondaryTechnicalLead?.lastName}`,
email: currentProject?.secondaryTechnicalLead?.email,
},
].filter((techLead) => techLead.email !== null),
].filter((techLead) => techLead.email !== undefined),
},
};
}
Expand Down
4 changes: 1 addition & 3 deletions src/scripts/newPublicCloudProjects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import getIdirUpn from '../../utils/getIdirUpn.js';
const prisma = new PrismaClient();

const mainFolderPath =
'src/scripts/newPublicCloudProjects/project_sets';
'src/scripts/newPublicCloudProjects/project_sets_all';

const parseMinistryFromDisplayName = (displayName) => {
if (displayName && displayName.length > 0) {
Expand All @@ -30,7 +30,6 @@ async function getUser(email) {

const usersData = await getIdirFromEmail(email);
const userData = usersData[0];

if (!userData) {
console.log('No user data found for email: ', email);
return undefined;
Expand Down Expand Up @@ -126,7 +125,6 @@ async function createProject(projectData) {
async function main() {
try {
const licensePlateFolders = await fs.readdir(mainFolderPath);

for (const licensePlateFolder of licensePlateFolders) {
const folderPath = path.join(mainFolderPath, licensePlateFolder);

Expand Down

0 comments on commit 0865eb8

Please sign in to comment.