add optional prefix to url
This commit is contained in:
@@ -142,9 +142,9 @@ func (h *Handlers) CreateNoteHandler(c *gin.Context) {
|
||||
}
|
||||
|
||||
// Redirect based on extension
|
||||
redirect := "/note/" + notePath
|
||||
redirect := h.config.URLPrefix + "/note/" + notePath
|
||||
if strings.ToLower(ext) != "md" {
|
||||
redirect = "/view_text/" + notePath
|
||||
redirect = h.config.URLPrefix + "/view_text/" + notePath
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
@@ -297,7 +297,7 @@ func (h *Handlers) EditNoteHandler(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"success": true,
|
||||
"message": "Note saved successfully",
|
||||
"redirect": "/note/" + notePath,
|
||||
"redirect": h.config.URLPrefix + "/note/" + notePath,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user