"applications", fixed double extension
This commit is contained in:
parent
2766de5b9d
commit
f0ecfb466b
1 changed files with 5 additions and 3 deletions
|
|
@ -173,6 +173,8 @@ const CSV_FIELDS = [
|
|||
"files_json"
|
||||
]
|
||||
|
||||
const APPLICATIONS_DIRECTORY = "applications"
|
||||
|
||||
function getApplicantDirectoryName(applicantDetails) {
|
||||
return `${sanitizeZipPathSegment(applicantDetails.last_name)}_${sanitizeZipPathSegment(applicantDetails.first_name)}`
|
||||
}
|
||||
|
|
@ -187,7 +189,7 @@ function getApplicantArchiveFileName(afile) {
|
|||
? `.${sanitizeZipPathSegment(sourceName.split(".").slice(-1)[0], "file")}`
|
||||
: ""
|
||||
const baseName = sanitizeZipPathSegment(afile.name, "file")
|
||||
return `${baseName}${extension}`
|
||||
return `${baseName}`
|
||||
}
|
||||
|
||||
function getApplicantArchiveFiles(applicantDetails) {
|
||||
|
|
@ -199,7 +201,7 @@ function getApplicantArchiveFiles(applicantDetails) {
|
|||
|
||||
return {
|
||||
fileName,
|
||||
relativePath: `${dirName}/${fileName}`
|
||||
relativePath: `${APPLICATIONS_DIRECTORY}/${dirName}/${fileName}`
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -470,7 +472,7 @@ function rip(event) {
|
|||
|
||||
const applicantDetails = result.value
|
||||
const dirName = getApplicantDirectoryName(applicantDetails)
|
||||
const applicantDir = zip.folder(dirName)
|
||||
const applicantDir = zip.folder(`${APPLICATIONS_DIRECTORY}/${dirName}`)
|
||||
const archiveFiles = getApplicantArchiveFiles(applicantDetails)
|
||||
|
||||
successfulApplicants.push(applicantDetails)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue