Add trello migration routes and status

This commit is contained in:
kolaente 2020-12-17 00:05:40 +01:00
parent 0941b7e1dd
commit 12b985b023
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 16 additions and 0 deletions

View File

@ -17,6 +17,7 @@
package v1
import (
"code.vikunja.io/api/pkg/modules/migration/trello"
"net/http"
"code.vikunja.io/api/pkg/log"
@ -115,6 +116,10 @@ func Info(c echo.Context) error {
m := &todoist.Migration{}
info.AvailableMigrators = append(info.AvailableMigrators, m.Name())
}
if config.MigrationTrelloEnable.GetBool() {
m := &trello.Migration{}
info.AvailableMigrators = append(info.AvailableMigrators, m.Name())
}
if config.BackgroundsEnabled.GetBool() {
if config.BackgroundsUploadEnabled.GetBool() {

View File

@ -47,6 +47,7 @@
package routes
import (
"code.vikunja.io/api/pkg/modules/migration/trello"
"strings"
"time"
@ -531,6 +532,16 @@ func registerAPIRoutes(a *echo.Group) {
todoistMigrationHandler.RegisterRoutes(m)
}
// Trello
if config.MigrationTrelloEnable.GetBool() {
trelloMigrationHandler := &migrationHandler.MigrationWeb{
MigrationStruct: func() migration.Migrator {
return &trello.Migration{}
},
}
trelloMigrationHandler.RegisterRoutes(m)
}
// List Backgrounds
if config.BackgroundsEnabled.GetBool() {
a.GET("/lists/:list/background", backgroundHandler.GetListBackground)