MM-13718 Prevent files from being attached to multiple posts (#10094)

* MM-13718 Prevent files from being attached to multiple posts

* Switch back to non-batched AttachToPost

* Change status code when failing to attach a file
Этот коммит содержится в:
Harrison Healey
2019-01-22 16:58:22 -04:00
коммит произвёл Christopher Speller
родитель f12680103a
Коммит 6325c5b569
10 изменённых файлов: 176 добавлений и 58 удалений

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

@@ -13,13 +13,13 @@ type FileInfoStore struct {
mock.Mock
}
// AttachToPost provides a mock function with given fields: fileId, postId
func (_m *FileInfoStore) AttachToPost(fileId string, postId string) store.StoreChannel {
ret := _m.Called(fileId, postId)
// AttachToPost provides a mock function with given fields: fileId, postId, creatorId
func (_m *FileInfoStore) AttachToPost(fileId string, postId string, creatorId string) store.StoreChannel {
ret := _m.Called(fileId, postId, creatorId)
var r0 store.StoreChannel
if rf, ok := ret.Get(0).(func(string, string) store.StoreChannel); ok {
r0 = rf(fileId, postId)
if rf, ok := ret.Get(0).(func(string, string, string) store.StoreChannel); ok {
r0 = rf(fileId, postId, creatorId)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(store.StoreChannel)