mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-08-08 15:05:26 +02:00
Prevented alias creation from empty uri
This commit is contained in:
parent
6f3d0a19a5
commit
4b08b1e62c
1 changed files with 9 additions and 7 deletions
|
@ -126,8 +126,7 @@ class Pages {
|
|||
const updatedPage = await page.save();
|
||||
|
||||
if (updatedPage.uri !== previousUri) {
|
||||
Alias.markAsDeprecated(previousUri);
|
||||
|
||||
if (updatedPage.uri) {
|
||||
const alias = new Alias({
|
||||
id: updatedPage._id,
|
||||
type: aliasTypes.PAGE
|
||||
|
@ -136,6 +135,9 @@ class Pages {
|
|||
alias.save();
|
||||
}
|
||||
|
||||
Alias.markAsDeprecated(previousUri);
|
||||
}
|
||||
|
||||
return updatedPage;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue