Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: listing of channels
Browse files Browse the repository at this point in the history
Signed-off-by: Arvindh <[email protected]>
arvindh123 committed Jan 17, 2025

Verified

This commit was signed with the committer’s verified signature.
arvindh123 Arvindh
1 parent 286d707 commit 9dc7809
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions clients/postgres/clients.go
Original file line number Diff line number Diff line change
@@ -901,6 +901,10 @@ func PageQuery(pm clients.Page) (string, error) {
query = append(query, mq)
}

if len(pm.IDs) != 0 {
query = append(query, fmt.Sprintf("c.id IN ('%s')", strings.Join(pm.IDs, "','")))
}

if pm.Status != clients.AllStatus {
query = append(query, "c.status = :status")
}
2 changes: 1 addition & 1 deletion clients/postgres/clients_test.go
Original file line number Diff line number Diff line change
@@ -1626,7 +1626,7 @@ func TestSearchClients(t *testing.T) {
}
}

func TestRetrievByIDs(t *testing.T) {
func TestRetrieveByIDs(t *testing.T) {
t.Cleanup(func() {
_, err := db.Exec("DELETE FROM clients")
require.Nil(t, err, fmt.Sprintf("clean clients unexpected error: %s", err))
1 change: 0 additions & 1 deletion pkg/sdk/setup_test.go
Original file line number Diff line number Diff line change
@@ -216,7 +216,6 @@ func convertChannel(g sdk.Channel) mgchannels.Channel {
UpdatedAt: g.UpdatedAt,
UpdatedBy: g.UpdatedBy,
Status: status,
Permissions: g.Permissions,
}
}

0 comments on commit 9dc7809

Please sign in to comment.