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 (mattermost-community#4802)
  • Loading branch information
mgdelacroix authored Jul 20, 2023
1 parent a745c29 commit e0dbb38
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 @@ -956,6 +956,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 e0dbb38

Please sign in to comment.