Accidentally sending file name instead of file path (#132)

Fixes issue with file uploader, where file path value was incorrect.
This commit is contained in:
Harrison (Harry) Cramer
2023-12-04 16:06:21 -05:00
committed by GitHub
parent c204ebc514
commit 63cbf41221

View File

@@ -70,9 +70,10 @@ func (a *api) attachmentHandler(w http.ResponseWriter, r *http.Request) {
return return
} }
file, err := a.fileReader.ReadFile(attachmentRequest.FileName) file, err := a.fileReader.ReadFile(attachmentRequest.FilePath)
if err != nil { if err != nil || file == nil {
handleError(w, err, fmt.Sprintf("Could not read %s file", attachmentRequest.FileName), http.StatusInternalServerError) handleError(w, err, fmt.Sprintf("Could not read %s file", attachmentRequest.FileName), http.StatusInternalServerError)
return
} }
projectFile, res, err := a.client.UploadFile(a.projectInfo.ProjectId, file, attachmentRequest.FileName) projectFile, res, err := a.client.UploadFile(a.projectInfo.ProjectId, file, attachmentRequest.FileName)