chore: comment unused functions

This commit is contained in:
Felipe M. 2023-10-29 15:42:57 +01:00
parent f16dd42e10
commit 1d58455b53
No known key found for this signature in database
GPG key ID: CCFBC5637D4000A8

View file

@ -27,42 +27,42 @@ func (r *BookmarkRoutes) Setup(group *gin.RouterGroup) model.Routes {
return r
}
func (r *BookmarkRoutes) bookmarkContentHandler(c *gin.Context) {
ctx := context.NewContextFromGin(c)
// func (r *BookmarkRoutes) bookmarkContentHandler(c *gin.Context) {
// ctx := context.NewContextFromGin(c)
bookmarkIDParam, present := c.Params.Get("id")
if !present {
response.SendError(c, 400, "Invalid bookmark ID")
return
}
// bookmarkIDParam, present := c.Params.Get("id")
// if !present {
// response.SendError(c, 400, "Invalid bookmark ID")
// return
// }
bookmarkID, err := strconv.Atoi(bookmarkIDParam)
if err != nil {
r.logger.WithError(err).Error("error parsing bookmark ID parameter")
response.SendInternalServerError(c)
return
}
// bookmarkID, err := strconv.Atoi(bookmarkIDParam)
// if err != nil {
// r.logger.WithError(err).Error("error parsing bookmark ID parameter")
// response.SendInternalServerError(c)
// return
// }
if bookmarkID == 0 {
response.SendError(c, 404, nil)
return
}
// if bookmarkID == 0 {
// response.SendError(c, 404, nil)
// return
// }
bookmark, found, err := r.deps.Database.GetBookmark(c, bookmarkID, "")
if err != nil || !found {
response.SendError(c, 404, nil)
return
}
// bookmark, found, err := r.deps.Database.GetBookmark(c, bookmarkID, "")
// if err != nil || !found {
// response.SendError(c, 404, nil)
// return
// }
if bookmark.Public != 1 && !ctx.UserIsLogged() {
response.SendError(c, http.StatusForbidden, nil)
return
}
// if bookmark.Public != 1 && !ctx.UserIsLogged() {
// response.SendError(c, http.StatusForbidden, nil)
// return
// }
response.Send(c, 200, bookmark.Content)
}
// response.Send(c, 200, bookmark.Content)
// }
func (r *BookmarkRoutes) bookmarkArchiveHandler(c *gin.Context) {}
// func (r *BookmarkRoutes) bookmarkArchiveHandler(c *gin.Context) {}
func NewBookmarkRoutes(logger *logrus.Logger, deps *config.Dependencies) *BookmarkRoutes {
return &BookmarkRoutes{