From ceac6b4b7967f6b07f1951a6c9393a5d8400e539 Mon Sep 17 00:00:00 2001 From: akeemphilbert Date: Sat, 22 Jul 2023 08:28:56 -0400 Subject: [PATCH] feature: #270 made the default projection a pointer on the API container --- controllers/rest/api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/rest/api.go b/controllers/rest/api.go index 7aba8169..4cf409ba 100644 --- a/controllers/rest/api.go +++ b/controllers/rest/api.go @@ -68,7 +68,7 @@ type RESTAPI struct { gormConnection *gorm.DB enforcers map[string]*casbin.Enforcer entityRepositories map[string]model.EntityRepository - defaultProjection model.Projection + defaultProjection *projections.GORMDB } //define an interface that all plugins must implement @@ -206,7 +206,7 @@ func (p *RESTAPI) RegisterCommandDispatcher(name string, dispatcher model.Comman //RegisterProjection Add command dispatcher so that it can be referenced in the OpenAPI spec func (p *RESTAPI) RegisterProjection(name string, projection model.Projection) { - p.defaultProjection = projection + p.defaultProjection = projection.(*projections.GORMDB) } //RegisterEntityFactory Adds entity factory so that it can be referenced in the OpenAPI spec