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 удалений

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

@@ -353,8 +353,8 @@ func TestEditChannelBookmark(t *testing.T) {
require.NotNil(t, cb)
patch := &model.ChannelBookmarkPatch{
DisplayName: model.NewString("Edited bookmark test"),
LinkUrl: model.NewString("http://edited.url"),
DisplayName: model.NewPointer("Edited bookmark test"),
LinkUrl: model.NewPointer("http://edited.url"),
}
ucb, resp, err := tc.userClient.UpdateChannelBookmark(context.Background(), cb.ChannelId, cb.Id, patch)
@@ -394,8 +394,8 @@ func TestEditChannelBookmark(t *testing.T) {
// try to patch the channel bookmark
patch := &model.ChannelBookmarkPatch{
DisplayName: model.NewString("Edited bookmark test"),
LinkUrl: model.NewString("http://edited.url"),
DisplayName: model.NewPointer("Edited bookmark test"),
LinkUrl: model.NewPointer("http://edited.url"),
}
ucb, resp, err := th.Client.UpdateChannelBookmark(context.Background(), cb.ChannelId, cb.Id, patch)
@@ -406,8 +406,8 @@ func TestEditChannelBookmark(t *testing.T) {
t.Run("trying to edit a nonexistent bookmark should fail", func(t *testing.T) {
patch := &model.ChannelBookmarkPatch{
DisplayName: model.NewString("Edited bookmark test"),
LinkUrl: model.NewString("http://edited.url"),
DisplayName: model.NewPointer("Edited bookmark test"),
LinkUrl: model.NewPointer("http://edited.url"),
}
ucb, resp, err := th.Client.UpdateChannelBookmark(context.Background(), th.BasicChannel.Id, model.NewId(), patch)
@@ -434,8 +434,8 @@ func TestEditChannelBookmark(t *testing.T) {
require.Nil(t, appErr)
patch := &model.ChannelBookmarkPatch{
DisplayName: model.NewString("Edited bookmark test"),
LinkUrl: model.NewString("http://edited.url"),
DisplayName: model.NewPointer("Edited bookmark test"),
LinkUrl: model.NewPointer("http://edited.url"),
}
ucb, resp, err := th.Client.UpdateChannelBookmark(context.Background(), cb.ChannelId, cb.Id, patch)
@@ -471,8 +471,8 @@ func TestEditChannelBookmark(t *testing.T) {
require.NotNil(t, cb)
patch := &model.ChannelBookmarkPatch{
DisplayName: model.NewString("Edited bookmark test"),
LinkUrl: model.NewString("http://edited.url"),
DisplayName: model.NewPointer("Edited bookmark test"),
LinkUrl: model.NewPointer("http://edited.url"),
}
ucb, resp, err := th.Client.UpdateChannelBookmark(context.Background(), cb.ChannelId, cb.Id, patch)
@@ -521,8 +521,8 @@ func TestEditChannelBookmark(t *testing.T) {
require.NotNil(t, cb)
patch := &model.ChannelBookmarkPatch{
DisplayName: model.NewString("Edited bookmark test"),
LinkUrl: model.NewString("http://edited.url"),
DisplayName: model.NewPointer("Edited bookmark test"),
LinkUrl: model.NewPointer("http://edited.url"),
}
ucb, resp, err := guestClient.UpdateChannelBookmark(context.Background(), cb.ChannelId, cb.Id, patch)
@@ -561,8 +561,8 @@ func TestEditChannelBookmark(t *testing.T) {
require.NotNil(t, cb)
patch := &model.ChannelBookmarkPatch{
DisplayName: model.NewString("Edited bookmark test"),
LinkUrl: model.NewString("http://edited.url"),
DisplayName: model.NewPointer("Edited bookmark test"),
LinkUrl: model.NewPointer("http://edited.url"),
}
// create a client for basic user 2
@@ -611,7 +611,7 @@ func TestEditChannelBookmark(t *testing.T) {
require.Nil(t, appErr)
require.NotNil(t, cb)
patch := &model.ChannelBookmarkPatch{DisplayName: model.NewString("Edited bookmark test")}
patch := &model.ChannelBookmarkPatch{DisplayName: model.NewPointer("Edited bookmark test")}
_, resp, err := th.Client.UpdateChannelBookmark(context.Background(), cb.ChannelId, cb.Id, patch)
require.NoError(t, err)
CheckOKStatus(t, resp)