OSF: Used model.NewPointer everywhere (#27838)

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2024-08-06 09:15:00 +05:30
коммит произвёл GitHub
родитель f290745496
Коммит c3ed07e679
148 изменённых файлов: 2341 добавлений и 2338 удалений

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

@@ -295,10 +295,10 @@ func TestProcessAttachments(t *testing.T) {
genAttachments := func() *[]imports.AttachmentImportData {
return &[]imports.AttachmentImportData{
{
Path: model.NewString("file.jpg"),
Path: model.NewPointer("file.jpg"),
},
{
Path: model.NewString("somedir/file.jpg"),
Path: model.NewPointer("somedir/file.jpg"),
},
}
}
@@ -320,24 +320,24 @@ func TestProcessAttachments(t *testing.T) {
userLine := imports.LineImportData{
Type: "user",
User: &imports.UserImportData{
ProfileImage: model.NewString("profile.jpg"),
ProfileImage: model.NewPointer("profile.jpg"),
},
}
emojiLine := imports.LineImportData{
Type: "emoji",
Emoji: &imports.EmojiImportData{
Image: model.NewString("emoji.png"),
Image: model.NewPointer("emoji.png"),
},
}
t.Run("empty path", func(t *testing.T) {
expected := &[]imports.AttachmentImportData{
{
Path: model.NewString("file.jpg"),
Path: model.NewPointer("file.jpg"),
},
{
Path: model.NewString("somedir/file.jpg"),
Path: model.NewPointer("somedir/file.jpg"),
},
}
@@ -352,10 +352,10 @@ func TestProcessAttachments(t *testing.T) {
t.Run("valid path", func(t *testing.T) {
expected := &[]imports.AttachmentImportData{
{
Path: model.NewString("/tmp/file.jpg"),
Path: model.NewPointer("/tmp/file.jpg"),
},
{
Path: model.NewString("/tmp/somedir/file.jpg"),
Path: model.NewPointer("/tmp/somedir/file.jpg"),
},
}
@@ -499,7 +499,7 @@ func TestImportBulkImportWithAttachments(t *testing.T) {
}
require.NotNil(t, jsonFile)
th.App.UpdateConfig(func(cfg *model.Config) { cfg.TeamSettings.MaxUsersPerTeam = model.NewInt(1000) })
th.App.UpdateConfig(func(cfg *model.Config) { cfg.TeamSettings.MaxUsersPerTeam = model.NewPointer(1000) })
appErr, _ := th.App.BulkImportWithPath(th.Context, jsonFile, importZipReader, false, true, 1, model.ExportDataDir)
require.Nil(t, appErr)