SMQ-2974 - Fix listing entities from different domains (#2975)

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
This commit is contained in:
Steve Munene
2025-06-26 15:12:57 +03:00
committed by GitHub
parent 9abdf39fd6
commit d9cf3851a1
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -192,6 +192,7 @@ func (svc service) ViewChannel(ctx context.Context, session authn.Session, id st
func (svc service) ListChannels(ctx context.Context, session authn.Session, pm Page) (ChannelsPage, error) {
switch session.SuperAdmin {
case true:
pm.Domain = session.DomainID
cp, err := svc.repo.RetrieveAll(ctx, pm)
if err != nil {
return ChannelsPage{}, errors.Wrap(svcerr.ErrViewEntity, err)
+1
View File
@@ -139,6 +139,7 @@ func (svc service) View(ctx context.Context, session authn.Session, id string, w
func (svc service) ListClients(ctx context.Context, session authn.Session, pm Page) (ClientsPage, error) {
switch session.SuperAdmin {
case true:
pm.Domain = session.DomainID
cp, err := svc.repo.RetrieveAll(ctx, pm)
if err != nil {
return ClientsPage{}, errors.Wrap(svcerr.ErrViewEntity, err)