Skip to content

Commit

Permalink
Fix: add timestamp to id upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Akalanka47000 committed Oct 14, 2023
1 parent 475551d commit 3420a70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/components/identification-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ const IdentificationForm = () => {
}
const members = await Promise.all(
formData.map(async (member, index) => {
member["student_id_url"] =
member["student_id_url"] || (await uploadIdCard(team.name, member.name, idFiles[index]));
if (idFiles[index]) {
member["student_id_url"] = await uploadIdCard(team.name, member.name, idFiles[index]);
}
return member;
})
);
Expand Down
6 changes: 5 additions & 1 deletion src/services/azure.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,9 @@ export const uploadSubmission = async (file) => {
};

export const uploadIdCard = async (teamName, userName, file) => {
return uploadFile(genericContainerClient, file, `documents/${teamName}/${userName}-${file.name}`);
return uploadFile(
genericContainerClient,
file,
`documents/${teamName}/${userName}-${file.name}-${new Date().toISOString()}`
);
};

0 comments on commit 3420a70

Please sign in to comment.