1
0

feat(migration): use new structure for migration

This commit is contained in:
kolaente
2022-12-29 18:11:15 +01:00
parent fef253312c
commit 386e218b95
8 changed files with 44 additions and 44 deletions

View File

@ -162,16 +162,16 @@ func getTrelloData(token string) (trelloData []*trello.Board, err error) {
// Converts all previously obtained data from trello into the vikunja format.
// `trelloData` should contain all boards with their projects and cards respectively.
func convertTrelloDataToVikunja(trelloData []*trello.Board, token string) (fullVikunjaHierachie []*models.NamespaceWithProjectsAndTasks, err error) {
func convertTrelloDataToVikunja(trelloData []*trello.Board, token string) (fullVikunjaHierachie []*models.ProjectWithTasksAndBuckets, err error) {
log.Debugf("[Trello Migration] ")
fullVikunjaHierachie = []*models.NamespaceWithProjectsAndTasks{
fullVikunjaHierachie = []*models.ProjectWithTasksAndBuckets{
{
Namespace: models.Namespace{
Project: models.Project{
Title: "Imported from Trello",
},
Projects: []*models.ProjectWithTasksAndBuckets{},
ChildProjects: []*models.ProjectWithTasksAndBuckets{},
},
}
@ -300,7 +300,7 @@ func convertTrelloDataToVikunja(trelloData []*trello.Board, token string) (fullV
log.Debugf("[Trello Migration] Converted all cards to tasks for board %s", board.ID)
fullVikunjaHierachie[0].Projects = append(fullVikunjaHierachie[0].Projects, project)
fullVikunjaHierachie[0].ChildProjects = append(fullVikunjaHierachie[0].ChildProjects, project)
}
return