9304 added the attachments import to direct post (#9308)
Этот коммит содержится в:
коммит произвёл
Carlos Tadeu Panato Junior
родитель
c2676d964e
Коммит
7a3cf112c5
@@ -1118,6 +1118,14 @@ func (a *App) ImportDirectPost(data *DirectPostImportData, dryRun bool) *model.A
|
||||
|
||||
post.Hashtags, _ = model.ParseHashtags(post.Message)
|
||||
|
||||
if data.Attachments != nil {
|
||||
fileIds, err := a.uploadAttachments(data.Attachments, post, "noteam", dryRun)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
post.FileIds = append(post.FileIds, fileIds...)
|
||||
}
|
||||
|
||||
if post.Id == "" {
|
||||
if result := <-a.Srv.Store.Post().Save(post); result.Err != nil {
|
||||
return result.Err
|
||||
@@ -1171,6 +1179,7 @@ func (a *App) ImportDirectPost(data *DirectPostImportData, dryRun bool) *model.A
|
||||
}
|
||||
}
|
||||
|
||||
a.UpdateFileInfoWithPostId(post)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user