fixed POST addview

This commit is contained in:
2024-04-19 17:37:59 +02:00
parent e998fb2ab4
commit be7f42aafe
3 changed files with 7 additions and 3 deletions

View File

@ -229,10 +229,11 @@ public class ResearchController {
///////
//views part
@PostMapping("/addview/{url}")
@PostMapping("/addview/cdn/{url}")
public ResponseEntity<ResearchDTO> addView(@PathVariable String url){
Research research = researchesServ.getResearchByUrl(url);
if (research ==null) return new ResponseEntity<>(HttpStatus.NOT_FOUND);
System.out.println(url);
Research research = researchesServ.getResearchByUrl("cdn/" + url);
if (research ==null) return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(ResearchDTO.construct(researchesServ.addView(research)), HttpStatus.OK);
}