diff options
-rw-r--r-- | api/import.go | 6 | ||||
-rw-r--r-- | i18n/en.json | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/api/import.go b/api/import.go index 63dfb033d..8681e74c8 100644 --- a/api/import.go +++ b/api/import.go @@ -35,6 +35,12 @@ func ImportPost(post *model.Post) { l4g.Debug(utils.T("api.import.import_post.saving.debug"), post.UserId, post.Message) } + for _, fileId := range post.FileIds { + if result := <-Srv.Store.FileInfo().AttachToPost(fileId, post.Id); result.Err != nil { + l4g.Error(utils.T("api.import.import_post.attach_files.error"), post.Id, post.FileIds, result.Err) + } + } + post.Id = "" post.CreateAt++ post.Message = remainder diff --git a/i18n/en.json b/i18n/en.json index 96961718e..a9dc90013 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1174,6 +1174,10 @@ "translation": "Initializing general API routes" }, { + "id": "api.import.import_post.attach_files.error", + "translation": "Error attaching files to post. postId=%v, fileIds=%v, message=%v" + }, + { "id": "api.import.import_post.saving.debug", "translation": "Error saving post. user=%v, message=%v" }, |