mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-08-08 23:15:28 +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();
|
const updatedPage = await page.save();
|
||||||
|
|
||||||
if (updatedPage.uri !== previousUri) {
|
if (updatedPage.uri !== previousUri) {
|
||||||
Alias.markAsDeprecated(previousUri);
|
if (updatedPage.uri) {
|
||||||
|
|
||||||
const alias = new Alias({
|
const alias = new Alias({
|
||||||
id: updatedPage._id,
|
id: updatedPage._id,
|
||||||
type: aliasTypes.PAGE
|
type: aliasTypes.PAGE
|
||||||
|
@ -136,6 +135,9 @@ class Pages {
|
||||||
alias.save();
|
alias.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Alias.markAsDeprecated(previousUri);
|
||||||
|
}
|
||||||
|
|
||||||
return updatedPage;
|
return updatedPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue