Add todoist migrator to available migrators in info endpoint if it is enabled
This commit is contained in:
parent
e89e6d47d4
commit
e9bc3246ce
1 changed files with 11 additions and 1 deletions
|
@ -18,6 +18,8 @@ package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.vikunja.io/api/pkg/config"
|
"code.vikunja.io/api/pkg/config"
|
||||||
|
"code.vikunja.io/api/pkg/modules/migration/todoist"
|
||||||
|
"code.vikunja.io/api/pkg/modules/migration/wunderlist"
|
||||||
"code.vikunja.io/api/pkg/version"
|
"code.vikunja.io/api/pkg/version"
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -51,8 +53,16 @@ func Info(c echo.Context) error {
|
||||||
RegistrationEnabled: config.ServiceEnableRegistration.GetBool(),
|
RegistrationEnabled: config.ServiceEnableRegistration.GetBool(),
|
||||||
TaskAttachmentsEnabled: config.ServiceEnableTaskAttachments.GetBool(),
|
TaskAttachmentsEnabled: config.ServiceEnableTaskAttachments.GetBool(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Migrators
|
||||||
if config.MigrationWunderlistEnable.GetBool() {
|
if config.MigrationWunderlistEnable.GetBool() {
|
||||||
infos.AvailableMigrators = append(infos.AvailableMigrators, "wunderlist")
|
m := &wunderlist.Migration{}
|
||||||
|
infos.AvailableMigrators = append(infos.AvailableMigrators, m.Name())
|
||||||
}
|
}
|
||||||
|
if config.MigrationTodoistEnable.GetBool() {
|
||||||
|
m := &todoist.Migration{}
|
||||||
|
infos.AvailableMigrators = append(infos.AvailableMigrators, m.Name())
|
||||||
|
}
|
||||||
|
|
||||||
return c.JSON(http.StatusOK, infos)
|
return c.JSON(http.StatusOK, infos)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue