Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Failure to fetch domains using status and permissions as query params. #2241

Open
wambui-pixel opened this issue May 16, 2024 · 0 comments
Labels

Comments

@wambui-pixel
Copy link

What were you trying to achieve?

Fetching of Domains using both the status and permissions as queryparams

What are the expected results?

A list of domains with the specified status and permissions

What are the received results?

This is the error gotten on magistrala:

ERROR: missing FROM-clause entry for table "pc" at character 269 magistrala-auth-db | 2024-05-16 13:13:24.133 UTC [29] STATEMENT: SELECT d.id as id, d.name as name, d.tags as tags, d.alias as alias, d.metadata as metadata, d.created_at as created_at, d.updated_at as updated_at, d.updated_by as updated_by, d.created_by as created_by, d.status as status

Steps To Reproduce

No response

In what environment did you encounter the issue?

Magistrala New UI.

Running this code:-
`const query = searchParams?.query || "";
// const domainsPage = await GetDomains({
let queryParams: PageMetadata = {
offset: (page > 0 ? page - 1 : 0) * limit,
limit,
name: query.trim(),
status: "enabled",
permission: "administrator",
}

if (user.role === "administrator") {
queryParams = {
offset: (page > 0 ? page - 1 : 0) * limit,
limit,
name: query.trim(),
status: "all",
}
}

const domainsPage = await GetDomains({
queryParams,
});`

ERROR: missing FROM-clause entry for table "pc" at character 269 magistrala-auth-db | 2024-05-16 13:13:24.133 UTC [29] STATEMENT: SELECT d.id as id, d.name as name, d.tags as tags, d.alias as alias, d.metadata as metadata, d.created_at as created_at, d.updated_at as updated_at, d.updated_by as updated_by, d.created_by as created_by, d.status as status

Additional information you deem important

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

1 participant