Skip to content

Commit

Permalink
fixed sanitized filelinks
Browse files Browse the repository at this point in the history
Signed-off-by: Rajiv Harlalka <[email protected]>
  • Loading branch information
rajivharlalka committed Oct 1, 2024
1 parent e567c45 commit cfff08f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions backend/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func HandleApprovePaper(w http.ResponseWriter, r *http.Request) {
CourseName: qpDetails.CourseName,
Year: qpDetails.Year,
Exam: qpDetails.Exam,
FileLink: destFileLink,
FileLink: utils.SanitizeFileLink(destFileLink),
ApproveStatus: true,
Semester: qpDetails.Semester,
FromLibrary: false,
Expand Down Expand Up @@ -371,8 +371,8 @@ func HandleDeletePaper(w http.ResponseWriter, r *http.Request) {
config.Get().Logger.Errorf("HandleDeletePaper: error soft-deleting paper: %+v PaperDetails: %d", err.Error(), requestBody.Id)
return
}
config.Get().Logger.Infof("HandleDeletePaper: disapproved paper: %d", requestBody.Id)
sendResponse(w, http.StatusOK, httpResp{Message: "File Disapproved successfully"})
config.Get().Logger.Infof("HandleDeletePaper: Deleted paper: %d", requestBody.Id)
sendResponse(w, http.StatusOK, httpResp{Message: "File Deleted successfully"})
}

func populateDB(filename string) error {
Expand Down
4 changes: 2 additions & 2 deletions backend/pkg/models/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
)

type QuestionPaper struct {
ID int `json:"id,string"`
ID int `json:"id"`
CourseCode string `json:"course_code"`
CourseName string `json:"course_name"`
Year int `json:"year,string"`
Year int `json:"year"`
Exam string `json:"exam"`
FileLink string `json:"filelink"`
FromLibrary bool `json:"from_library"`
Expand Down

0 comments on commit cfff08f

Please sign in to comment.