From 12b985b02389aa59be3647db0e9449dfb6b651f0 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 17 Dec 2020 00:05:40 +0100 Subject: [PATCH] Add trello migration routes and status --- pkg/routes/api/v1/info.go | 5 +++++ pkg/routes/routes.go | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/pkg/routes/api/v1/info.go b/pkg/routes/api/v1/info.go index 8b1e97dad..b13e50cf9 100644 --- a/pkg/routes/api/v1/info.go +++ b/pkg/routes/api/v1/info.go @@ -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() { diff --git a/pkg/routes/routes.go b/pkg/routes/routes.go index 83cccfcb5..a5680f08f 100644 --- a/pkg/routes/routes.go +++ b/pkg/routes/routes.go @@ -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)