Bootstrap copied BFF and local accounts with public Sendico contracts (#34)
This commit is contained in:
1 parent
67dc5b5b1e
commit
7062672a87
556 files changed
+42291
-777
No files matched your search
@@ -0,0 +1,20 @@
|
||||
package mutil
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.sendico.io/tech/sxchnge/bff/pkg/db/repository"
|
||||
"git.sendico.io/tech/sxchnge/bff/pkg/db/storable"
|
||||
"git.sendico.io/tech/sxchnge/bff/pkg/mlogger"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func GetObjectByID(ctx context.Context, logger mlogger.Logger, id string, val storable.Storable, repo repository.Repository) error {
|
||||
p, err := bson.ObjectIDFromHex(id)
|
||||
if err != nil {
|
||||
logger.Warn("Failed to decode object reference", zap.String("reference", id), zap.String("collection", val.Collection()))
|
||||
return err
|
||||
}
|
||||
return repo.Get(ctx, p, val)
|
||||
}
|
||||
Reference in new issue
Block a user