Adds the parent ID filter when fetching child blocks to extract fileId and attachmentId (#4802)
This commit is contained in:
parent
a745c29cb1
commit
e0dbb380a3
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue