fix issues with homepages...

This commit is contained in:
MiniDigger | Martin 2022-07-30 18:09:16 +02:00
parent 10fa501863
commit 2d5363eade

View File

@ -105,14 +105,17 @@ public class ProjectPageService extends HangarComponent {
}
public ExtendedProjectPage getProjectPage(String author, String slug, String requestUri) {
String path = requestUri.replace("/api/internal/pages/page/" + author + "/" + slug + "/", "");
String path = requestUri.replace("/api/internal/pages/page/" + author + "/" + slug, "");
ExtendedProjectPage pageTable;
if (path.equals("/")) {
if (path.equals("") || path.equals("/")) {
pageTable = hangarProjectPagesDAO.getHomePage(author, slug);
} else {
if (path.endsWith("/")) {
path = path.substring(0, path.length() - 1);
}
if (path.startsWith("/")) {
path = path.substring(1);
}
pageTable = hangarProjectPagesDAO.getProjectPage(author, slug, path);
}
if (pageTable == null) {