Default Action parameters list

37 views
Skip to first unread message

Andre Correa

unread,
Jan 20, 2022, 5:49:25 PM1/20/22
to Fusio
Hello,

I've noticed that routes and actions accept some default parameters like 'count' and 'startIndex'. Is there a list of all the accepted parameters and their possible values?  I'm asking because I also see 'sortOrder' should be an accepted parameter, but I don't know what it expects and 'ASC' and 'DESC' don't have any effect.

Ex: count=3&startIndex=31&sortBy=family&sortOrder=ASC

Thank you,

Andre

Christoph Kappestein

unread,
Jan 21, 2022, 2:47:45 PM1/21/22
to Fusio
Hi Andre,

this depends always on the action which is assigned to a route, in your case I would guess that you are using the "SqlSelectAll" action s. https://github.com/apioo/fusio-adapter-sql/blob/master/src/Action/SqlSelectAll.php#L132
In this case ASC and DESC should be the correct values, the sortBy column must be of course valid otherwise the sorting will not work.

best regards
Christoph

Andre Correa

unread,
Jan 21, 2022, 2:58:27 PM1/21/22
to Fusio
Thank you!
I'll check it out.  Now I know where to look for this information.
Regards.

Andre Correa

unread,
Jan 21, 2022, 4:11:28 PM1/21/22
to Fusio
Sorry, I couldn't get it to work.  I have a SqlQueryAll action like this:

{ "connection": "2", "sql": "SELECT id, name FROM family", "limit": 25 }

And a simple passthru route '/family' that points to that action. Then I make this HTTP GET request:

/family/?orderBy=name&sortOrder=DESC

But it continues to order by id', which is the primary key on the table.  I expected it to query the database as:

SELECT * FROM family ORDER BY name DESC

Can you please tell me what I'm missing?

Thank you!

Andre

Christoph Kappestein

unread,
Jan 23, 2022, 2:13:57 PM1/23/22
to Fusio
Hi Andre,

yes, so you need to use the "sortBy" instead of "orderBy" query parameter then it should work as expected.

best regards
Christoph
Reply all
Reply to author
Forward
0 new messages