Skip to content

Commit

Permalink
fix: page rendering (closes #1446)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniDigger committed Jan 31, 2025
1 parent 1a0a614 commit 3f2ee88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

// @el(author: String, slug: String, projectId: long)
// @el(author: String, slug: String, projectId: long, project: ProjectTable)
@Anyone
@RestController
@RateLimit(path = "projectpage")
Expand Down Expand Up @@ -75,7 +75,7 @@ public ResponseEntity<ExtendedProjectPage> getProjectPage(@PathVariable final Pr

@Unlocked
@RateLimit(overdraft = 5, refillTokens = 1, refillSeconds = 20)
@VisibilityRequired(type = VisibilityRequired.Type.PROJECT, args = "{#project}")
@VisibilityRequired(type = VisibilityRequired.Type.PROJECT, args = "{#projectId}")
@GetMapping("/list/{projectId}")
@ResponseStatus(HttpStatus.OK)
public ResponseEntity<Collection<HangarProjectPage>> listProjectPages(@PathVariable final long projectId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ private HangarProjectPage findById(final long id, final Map<Long, HangarProjectP
return null;
}

public ExtendedProjectPage getProjectPageFromURI(final ProjectTable slug, final String uri) {
final String path = uri.replace("/api/internal/pages/page/" + slug, "");
return this.getProjectPage(slug, path);
public ExtendedProjectPage getProjectPageFromURI(final ProjectTable project, final String uri) {
final String path = uri.replace("/api/internal/pages/page/" + project.getSlug(), "");
return this.getProjectPage(project, path);
}

public ExtendedProjectPage getProjectPage(final ProjectTable project, String path) {
Expand Down

0 comments on commit 3f2ee88

Please sign in to comment.