[MM-62541] Exclude files not attached to a post from the file count for a channel (#29976)

* [MM-62541] Exclude files not attached to a post from the file count for a channel

* Added test to ensure that we only grab files with a post id
Этот коммит содержится в:
Devin Binnie
2025-01-28 08:17:11 -05:00
коммит произвёл GitHub
родитель fd213358f0
Коммит 64070b0780
2 изменённых файлов: 53 добавлений и 0 удалений

Просмотреть файл

@@ -2329,6 +2329,7 @@ func (s SqlChannelStore) GetFileCount(channelId string) (int64, error) {
FileInfo
WHERE
FileInfo.DeleteAt = 0
AND FileInfo.PostId != ''
AND FileInfo.ChannelId = ?`,
channelId)
if err != nil {