mirror of
https://github.com/absmach/magistrala.git
synced 2026-06-23 04:10:28 +00:00
SMQ-2974 - Fix listing entities from different domains (#2975)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user