Backend: Don't abort import / index options API requests
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
parent
86c8723f79
commit
871c5aae9c
2 changed files with 2 additions and 4 deletions
|
@ -29,8 +29,7 @@ func GetImportOptions(router *gin.RouterGroup, conf *config.Config) {
|
||||||
dirs, err := fs.Dirs(conf.ImportPath(), true)
|
dirs, err := fs.Dirs(conf.ImportPath(), true)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"error": txt.UcFirst(err.Error())})
|
log.Errorf("import: %s", err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(http.StatusOK, gin.H{"dirs": dirs})
|
c.JSON(http.StatusOK, gin.H{"dirs": dirs})
|
||||||
|
|
|
@ -27,8 +27,7 @@ func GetIndexingOptions(router *gin.RouterGroup, conf *config.Config) {
|
||||||
dirs, err := fs.Dirs(conf.OriginalsPath(), true)
|
dirs, err := fs.Dirs(conf.OriginalsPath(), true)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"error": txt.UcFirst(err.Error())})
|
log.Errorf("index: %s", err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(http.StatusOK, gin.H{"dirs": dirs})
|
c.JSON(http.StatusOK, gin.H{"dirs": dirs})
|
||||||
|
|
Loading…
Reference in a new issue