mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
MM-56774: Delete file along with bookmark (#27495)
This commit is contained in:
parent
762ff9b96c
commit
90534b13cf
@ -317,7 +317,6 @@ func (s *SqlChannelBookmarkStore) Delete(bookmarkId string, deleteFile bool) err
|
||||
From("ChannelBookmarks").
|
||||
Where(sq.And{
|
||||
sq.Eq{"Id": bookmarkId},
|
||||
sq.Eq{"DeleteAt": 0},
|
||||
})
|
||||
|
||||
fileQuery, fileArgs, fileErr := s.getQueryBuilder().
|
||||
|
@ -434,6 +434,11 @@ func testDeleteChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
err = ss.ChannelBookmark().Delete(bookmark2.Id, true)
|
||||
assert.NoError(t, err)
|
||||
|
||||
_, err = ss.FileInfo().Get(file.Id)
|
||||
assert.Error(t, err)
|
||||
var nfErr *store.ErrNotFound
|
||||
assert.ErrorAs(t, err, &nfErr)
|
||||
|
||||
bookmarks, err := ss.ChannelBookmark().GetBookmarksForChannelSince(channelId, now)
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, bookmarks, 2) // we have two as the deleted record also gets returned for sync'ing purposes
|
||||
|
Loading…
Reference in New Issue
Block a user