Skip to content

Commit

Permalink
fix(api): jury file was not registering the correct path in database
Browse files Browse the repository at this point in the history
  • Loading branch information
agarbe committed Sep 9, 2024
1 parent 26d539e commit 45e8a3f
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions packages/reva-api/modules/jury/features/scheduleSessionOfJury.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@ export const scheduleSessionOfJury = async (params: ScheduleSessionOfJury) => {
}

const convocationFileId = uuidV4();
const convocationFilePath = `candidacies/${candidacyId}/jury/${convocationFileId}`;

if (convocationFile) {
const filePath = `candidacies/${candidacyId}/jury/${convocationFileId}`;
await uploadFileToS3({
filePath,
filePath: convocationFilePath,
mimeType: convocationFile.mimetype,
data: convocationFile._buf,
});
Expand All @@ -123,16 +124,17 @@ export const scheduleSessionOfJury = async (params: ScheduleSessionOfJury) => {
timeSpecified,
addressOfSession: address,
informationOfSession: information,
convocationFile: convocationFile
? {
create: {
name: convocationFile.filename,
mimeType: convocationFile.mimetype,
id: convocationFileId,
path: `${candidacyId}/${convocationFileId}`,
},
}
: undefined,
convocationFile:
convocationFile && convocationFilePath
? {
create: {
name: convocationFile.filename,
mimeType: convocationFile.mimetype,
id: convocationFileId,
path: convocationFilePath,
},
}
: undefined,
certificationAuthority: {
connect: {
id: candidacy.Feasibility[0].certificationAuthorityId || "",
Expand Down

0 comments on commit 45e8a3f

Please sign in to comment.