Skip to content

Commit 3fc9db4

Browse files
committed
fix(customize): delete board_sprints before import sprints
1 parent ec422dd commit 3fc9db4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

backend/plugins/customize/service/service.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ func (s *Service) createOrUpdateAccount(accountName string, rawDataParams string
283283
},
284284
FullName: accountName,
285285
UserName: accountName,
286-
CreatedDate: &now,
286+
CreatedDate: &now, // FIXME: will update created_date if already exists. to debug, using created_at instead
287287
}
288288
err := s.dal.CreateOrUpdate(account)
289289
if err != nil {
@@ -570,6 +570,13 @@ func (s *Service) ImportSprint(boardId string, file io.ReadCloser, incremental b
570570
if err != nil {
571571
return err
572572
}
573+
err = s.dal.Delete(
574+
&ticket.BoardSprint{},
575+
dal.Where("board_id = ?", boardId),
576+
)
577+
if err != nil {
578+
return err
579+
}
573580
}
574581
return s.importCSV(file, boardId, s.sprintHandler(boardId))
575582
}

0 commit comments

Comments
 (0)