Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/submission upload #249

Closed
wants to merge 15 commits into from
Closed
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedMethods("*")
.allowedOrigins("*")
.exposedHeaders("Content-Disposition")
.allowedHeaders("*");

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

Expand Down Expand Up @@ -203,6 +204,7 @@ public ResponseEntity<?> getSubmissions(@PathVariable("projectid") long projecti
*/
@PostMapping(ApiRoutes.PROJECT_BASE_PATH + "/{projectid}/submit")
//Route to submit a file, it accepts a multiform with the file and submissionTime
@Transactional
@Roles({UserRole.teacher, UserRole.student})
public ResponseEntity<?> submitFile(@RequestParam("file") MultipartFile file, @PathVariable("projectid") long projectid, Auth auth) {
long userId = auth.getUserEntity().getId();
Expand Down
85 changes: 83 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"framer-motion": "^11.0.24",
"highlight.js": "^11.9.0",
"i18next-localstorage-cache": "^1.1.1",
"jszip": "^3.10.1",
"lowlight": "^3.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
Loading
Loading