Skip to content

Commit

Permalink
Adds endpoint to get scheme version of advert
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanwrightAND committed Jan 29, 2024
1 parent 7aed984 commit 8c2fbd4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public WebSecurityCustomizer webSecurityCustomizer() {
"/health",
"/grant-applicant/register",
"/submissions/{submissionId}/question/{questionId}/attachment/scanresult",
"/grant-adverts/{advertSlug}/scheme-version",
"/jwt/isValid");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,12 @@ public ResponseEntity<String> validateGrantWebpageUrl(

return ResponseEntity.ok("Success");
}

@GetMapping("/{advertSlug}/scheme-version")
@Operation(summary = "Get advert scheme version")
public ResponseEntity<Integer> getAdvertSchemeVersion(@PathVariable final String advertSlug) {
GrantAdvert advert = grantAdvertService.getAdvertByContentfulSlug(advertSlug);
return ResponseEntity.ok(advert.getScheme().getVersion());
}

}

0 comments on commit 8c2fbd4

Please sign in to comment.