diff --git a/backend/handlers.go b/backend/handlers.go index d6c91146..3826709c 100644 --- a/backend/handlers.go +++ b/backend/handlers.go @@ -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, @@ -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 { diff --git a/backend/pkg/models/model.go b/backend/pkg/models/model.go index aea7f309..3df228be 100644 --- a/backend/pkg/models/model.go +++ b/backend/pkg/models/model.go @@ -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"`