From a375aee477bd9bf303fbdcf68bc3028e7096c970 Mon Sep 17 00:00:00 2001 From: skeris Date: Fri, 15 Sep 2023 01:01:38 +0300 Subject: [PATCH 1/4] fix: remove regexp from dto --- internal/dto/get_histories.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/internal/dto/get_histories.go b/internal/dto/get_histories.go index f1b062e..058e725 100644 --- a/internal/dto/get_histories.go +++ b/internal/dto/get_histories.go @@ -15,10 +15,7 @@ type GetHistories struct { func (receiver *GetHistories) BSON() bson.M { query := bson.M{ fields.History.IsDeleted: false, - } - - if receiver.Type != nil { - query[fields.History.Type] = bsontools.BuildCaseInsensitiveRegex(*receiver.Type) + fields.History.Type: *reciever.Type, } return query From 62a9faffbe8669d4f28bc1abf36f6dedd6165d1f Mon Sep 17 00:00:00 2001 From: skeris Date: Fri, 15 Sep 2023 01:08:35 +0300 Subject: [PATCH 2/4] fix: remove regexp from dto --- internal/dto/get_histories.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/dto/get_histories.go b/internal/dto/get_histories.go index 058e725..832cbf9 100644 --- a/internal/dto/get_histories.go +++ b/internal/dto/get_histories.go @@ -15,7 +15,7 @@ type GetHistories struct { func (receiver *GetHistories) BSON() bson.M { query := bson.M{ fields.History.IsDeleted: false, - fields.History.Type: *reciever.Type, + fields.History.Type: *receiver.Type, } return query From 6a50acdee83caa7147f3577cdcc8f12e781e9c85 Mon Sep 17 00:00:00 2001 From: skeris Date: Fri, 15 Sep 2023 01:12:25 +0300 Subject: [PATCH 3/4] fix: remove regexp from dto --- internal/dto/get_histories.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/dto/get_histories.go b/internal/dto/get_histories.go index 832cbf9..a471797 100644 --- a/internal/dto/get_histories.go +++ b/internal/dto/get_histories.go @@ -4,7 +4,6 @@ import ( "go.mongodb.org/mongo-driver/bson" "penahub.gitlab.yandexcloud.net/pena-services/customer/internal/fields" "penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models" - "penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/bsontools" ) type GetHistories struct { From f1857750fd1acd4d4ce797a1f873ddbc2c205490 Mon Sep 17 00:00:00 2001 From: skeris Date: Fri, 15 Sep 2023 01:23:20 +0300 Subject: [PATCH 4/4] fix: remove regexp from dto --- internal/dto/get_histories.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/dto/get_histories.go b/internal/dto/get_histories.go index a471797..ca0f9f1 100644 --- a/internal/dto/get_histories.go +++ b/internal/dto/get_histories.go @@ -14,7 +14,7 @@ type GetHistories struct { func (receiver *GetHistories) BSON() bson.M { query := bson.M{ fields.History.IsDeleted: false, - fields.History.Type: *receiver.Type, + fields.History.Type: *receiver.Type, } return query