Skip to content

Commit

Permalink
Adds the parent ID filter when fetching child blocks to extract fileI…
Browse files Browse the repository at this point in the history
…d and attachmentId (#4802) (#4810)

(cherry picked from commit e0dbb38)

Co-authored-by: Miguel de la Cruz <[email protected]>
  • Loading branch information
mattermost-build and mgdelacroix authored Jul 21, 2023
1 parent b4c7a99 commit 691a61d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/services/store/sqlstore/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,10 @@ func (s *SQLStore) deleteBlockChildren(db sq.BaseRunner, boardID string, parentI
From(s.tablePrefix + "blocks").
Where(sq.Eq{"board_id": boardID})

if parentID != "" {
fileDeleteQuery = fileDeleteQuery.Where(sq.Eq{"parent_id": parentID})
}

rows, err := fileDeleteQuery.Query()
if err != nil {
return err
Expand Down

0 comments on commit 691a61d

Please sign in to comment.