Skip to content

Commit

Permalink
fix title when copying
Browse files Browse the repository at this point in the history
  • Loading branch information
uidp committed May 18, 2024
1 parent 94f03af commit ad3d49f
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ export class ColumnBoardCopyService {
}): Promise<CopyStatus> {
const originalBoard = await this.boardNodeService.findByClassAndId(ColumnBoard, props.originalColumnBoardId);

if (props.copyTitle) {
originalBoard.title = props.copyTitle;
} else {
originalBoard.title = await this.columnBoardTitleService.deriveColumnBoardTitle(
originalBoard.title,
props.destinationExternalReference
);
}

const user = await this.userService.findById(props.userId);
/* istanbul ignore next */
if (originalBoard.context.type !== BoardExternalReferenceType.Course) {
Expand All @@ -59,6 +50,14 @@ export class ColumnBoardCopyService {
throw new InternalServerErrorException('expected copy of columnboard to be a columnboard');
}

if (props.copyTitle) {
copyStatus.copyEntity.title = props.copyTitle;
} else {
copyStatus.copyEntity.title = await this.columnBoardTitleService.deriveColumnBoardTitle(
originalBoard.title,
props.destinationExternalReference
);
}
copyStatus.copyEntity.context = props.destinationExternalReference;
await this.boardNodeService.addRoot(copyStatus.copyEntity);

Expand Down

0 comments on commit ad3d49f

Please sign in to comment.