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

orderBy to accept array of strings instead #140

Closed
pisethx opened this issue Nov 3, 2020 · 2 comments · Fixed by #148
Closed

orderBy to accept array of strings instead #140

pisethx opened this issue Nov 3, 2020 · 2 comments · Fixed by #148
Labels

Comments

@pisethx
Copy link

pisethx commented Nov 3, 2020

In the documents, it says:

await Model.orderBy('-created_at', 'category_id')

is it possible to somehow pass an array of strings as the args?

@JoaoPedroAS51
Copy link
Collaborator

Hi @rancou! You can use the spread syntax:

await Model.orderBy(...myArray)

@github-actions
Copy link

🎉 This issue has been resolved in version 1.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants