summaryrefslogtreecommitdiff
path: root/lib/response.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/response.js')
-rw-r--r--lib/response.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/response.js b/lib/response.js
index 6450bdf5..cf4b5c1d 100644
--- a/lib/response.js
+++ b/lib/response.js
@@ -123,10 +123,10 @@ function newNote (req, res, next) {
}
models.Note.create({
ownerId: owner,
- alias: req.alias ? req.alias : null,
+ alias: req.alias ? req.alias : (config.allowFreeURL ? (req.params.alias ? req.params.alias : null) : null),
content: body
}).then(function (note) {
- return res.redirect(config.serverURL + '/' + models.Note.encodeNoteId(note.id))
+ return res.redirect(config.serverURL + '/' + (note.alias ? note.alias : models.Note.encodeNoteId(note.id)))
}).catch(function (err) {
logger.error(err)
return response.errorInternalError(res)