From 24ff8d5d387a31a76dca47704aafb211842ec707 Mon Sep 17 00:00:00 2001 From: Scott Bishel Date: Tue, 3 May 2022 12:44:34 -0600 Subject: [PATCH] update board title when duplicated (#3011) --- server/services/store/sqlstore/boards_and_blocks.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/services/store/sqlstore/boards_and_blocks.go b/server/services/store/sqlstore/boards_and_blocks.go index caae65922..8d9224e92 100644 --- a/server/services/store/sqlstore/boards_and_blocks.go +++ b/server/services/store/sqlstore/boards_and_blocks.go @@ -141,6 +141,16 @@ func (s *SQLStore) duplicateBoard(db sq.BaseRunner, boardID string, userID strin if err != nil { return nil, nil, err } + + // todo: server localization + if asTemplate == board.IsTemplate { + // board -> board or template -> template + board.Title += " copy" + } else if asTemplate { + // template from board + board.Title = "New board template" + } + // make new board private board.Type = "P" board.IsTemplate = asTemplate