You've already forked focalboard
mirror of
https://github.com/mattermost/focalboard.git
synced 2025-07-15 23:54:29 +02:00
Copy images when duplicating card/board (#2253)
* copy image for card/board dup * revert store changes * revert store changes
This commit is contained in:
@ -297,7 +297,7 @@ func (a *API) handleGetBlocks(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
case blockID != "":
|
||||
block, err = a.app.GetBlockWithID(*container, blockID)
|
||||
block, err = a.app.GetBlockByID(*container, blockID)
|
||||
if err != nil {
|
||||
a.errorResponse(w, r.URL.Path, http.StatusInternalServerError, "", err)
|
||||
return
|
||||
@ -440,11 +440,10 @@ func (a *API) handlePostBlocks(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
session := ctx.Value(sessionContextKey).(*model.Session)
|
||||
|
||||
// this query param exists only when creating
|
||||
// template from board
|
||||
// this query param exists when creating template from board, or board from template
|
||||
sourceBoardID := r.URL.Query().Get("sourceBoardID")
|
||||
if sourceBoardID != "" {
|
||||
if updateFileIDsErr := a.app.CopyCardFiles(sourceBoardID, blocks); updateFileIDsErr != nil {
|
||||
if updateFileIDsErr := a.app.CopyCardFiles(sourceBoardID, container.WorkspaceID, blocks); updateFileIDsErr != nil {
|
||||
a.errorResponse(w, r.URL.Path, http.StatusInternalServerError, "", updateFileIDsErr)
|
||||
return
|
||||
}
|
||||
@ -1460,7 +1459,7 @@ func (a *API) handleCreateSubscription(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
// check for valid block
|
||||
block, err := a.app.GetBlockWithID(*container, sub.BlockID)
|
||||
block, err := a.app.GetBlockByID(*container, sub.BlockID)
|
||||
if err != nil || block == nil {
|
||||
a.errorResponse(w, r.URL.Path, http.StatusBadRequest, "invalid blockID", err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user