[MM-42194] Get file information from a deleted post (#20279)

* Introduced inlcude_deleted query parameter to allow admins to retrieve contents of post regardless of deletion status

* Introduced new client route and tests for getting file info of deleted posts

* Fixed tests due to caching of posts

* gofmt

* Small formatting updates

* Invalidating file infos cache on delete of post if post includes files

* Including deleted in migration flow

* Moved invalidating of cache

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Riccardo Santoni
2022-07-21 17:11:08 +02:00
коммит произвёл GitHub
родитель bc7f961d75
Коммит 3d7859396d
9 изменённых файлов: 75 добавлений и 16 удалений

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

@@ -219,7 +219,7 @@ func TestAttachFilesToPost(t *testing.T) {
appErr := th.App.attachFilesToPost(post)
assert.Nil(t, appErr)
infos, appErr := th.App.GetFileInfosForPost(post.Id, false)
infos, appErr := th.App.GetFileInfosForPost(post.Id, false, false)
assert.Nil(t, appErr)
assert.Len(t, infos, 2)
})
@@ -247,7 +247,7 @@ func TestAttachFilesToPost(t *testing.T) {
appErr := th.App.attachFilesToPost(post)
assert.Nil(t, appErr)
infos, appErr := th.App.GetFileInfosForPost(post.Id, false)
infos, appErr := th.App.GetFileInfosForPost(post.Id, false, false)
assert.Nil(t, appErr)
assert.Len(t, infos, 1)
assert.Equal(t, info2.Id, infos[0].Id)