diff options
Diffstat (limited to 'lib/apiv1/folders.go')
-rw-r--r-- | lib/apiv1/folders.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/apiv1/folders.go b/lib/apiv1/folders.go index f957c6d..cf56c3f 100644 --- a/lib/apiv1/folders.go +++ b/lib/apiv1/folders.go @@ -43,6 +43,21 @@ func (s *APIService) addFolder(c *gin.Context) { c.JSON(http.StatusOK, newFld) } +// syncFolder force synchronization of folder files +func (s *APIService) syncFolder(c *gin.Context) { + id := c.Param("id") + + s.log.Debugln("Sync folder id: ", id) + + err := s.mfolders.ForceSync(id) + if err != nil { + common.APIError(c, err.Error()) + return + } + + c.JSON(http.StatusOK, "") +} + // delFolder deletes folder from server config func (s *APIService) delFolder(c *gin.Context) { id := c.Param("id") @@ -55,5 +70,4 @@ func (s *APIService) delFolder(c *gin.Context) { return } c.JSON(http.StatusOK, delEntry) - } |