Skip to content

Commit

Permalink
feat: Allow to create a root note page other that the homepage - EXO-…
Browse files Browse the repository at this point in the history
…70331 - Meeds-io/MIPs#119

This change is going to allow to create a root note page other that the
homepage .
  • Loading branch information
sofyenne committed Mar 26, 2024
1 parent da44e5b commit e028186
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public Page createPage(Wiki wiki, Page parentPage, Page page) throws WikiExcepti
PageEntity createdPageEntity = pageDAO.create(pageEntity);

// if the page to create is the Home, update the wiki
if (parentPage == null) {
if (parentPage == null && NoteConstants.NOTE_HOME_NAME.equals(createdPageEntity.getName())) {
wikiEntity.setWikiHome(createdPageEntity);
wikiDAO.update(wikiEntity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ public Page createNote(Wiki noteBook, Page parentPage, Page note) throws WikiExc
createdPage.setAppName(note.getAppName());
createdPage.setUrl(Utils.getPageUrl(createdPage));
createdPage.setLang(note.getLang());
invalidateCache(parentPage);
if (parentPage != null) {
invalidateCache(parentPage);
}
invalidateCache(note);

Utils.broadcast(listenerService, "note.posted", note.getAuthor(), createdPage);
Expand Down

0 comments on commit e028186

Please sign in to comment.