From 5692d7e43deed075c6a7e866c4de1178774f734a Mon Sep 17 00:00:00 2001 From: Pavel Antonov <antonov@perx.ru> Date: Mon, 29 May 2023 07:35:34 +0000 Subject: [PATCH] Revert "Merge branch 'feature/PRXS-1285-ItemsFix' into 'master'" This reverts merge request !51 --- perxis-proto | 2 +- pkg/items/pagination.go | 4 +--- pkg/items/service.go | 22 ---------------------- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/perxis-proto b/perxis-proto index f000812a..8606df02 160000 --- a/perxis-proto +++ b/perxis-proto @@ -1 +1 @@ -Subproject commit f000812a1eef24093c0d0abf1318e3179b679773 +Subproject commit 8606df02e0df6807e503bf22471a295020a47fba diff --git a/pkg/items/pagination.go b/pkg/items/pagination.go index 2e6fdd56..6fe197d7 100644 --- a/pkg/items/pagination.go +++ b/pkg/items/pagination.go @@ -10,9 +10,7 @@ import ( ) type BatchProcessor struct { - Items Items // fixme: после того как здесь Content поменяли на Items (из-за цикличного импорта) - // использование в perxis BatchProcessor'a необходимо менять - // стоит ли это так делать или лучше в perxis-go BatchProcessor вынести в отдельный пакет чтобы не было цикличного импорта? + Items Items SpaceID, EnvID, CollectionID string FindOptions *FindOptions FindPublishedOptions *FindPublishedOptions diff --git a/pkg/items/service.go b/pkg/items/service.go index 6a550dd0..51d65d5b 100644 --- a/pkg/items/service.go +++ b/pkg/items/service.go @@ -149,25 +149,3 @@ func EncodeAggregateResult(ctx context.Context, request map[string]string, r map return result, nil } - -func CreateAndPublishItem(ctx context.Context, items Items, item *Item) error { - var err error - if item, err = items.Create(ctx, item); err != nil { - return errors.Wrap(err, "create item") - } - if err = items.Publish(ctx, item); err != nil { - return errors.Wrap(err, "publish item") - } - return nil -} - -func UpdateAndPublishItem(ctx context.Context, items Items, item *Item) error { - var err error - if err = items.Update(ctx, item); err != nil { - return errors.Wrap(err, "update item") - } - if err = items.Publish(ctx, item); err != nil { - return errors.Wrap(err, "publish item") - } - return nil -} -- GitLab