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

Code Refactoring Request: Supabase queries #105

Open
randysim opened this issue Jun 29, 2024 · 0 comments
Open

Code Refactoring Request: Supabase queries #105

randysim opened this issue Jun 29, 2024 · 0 comments
Labels
good first issue Good for newcomers refactor refactor code

Comments

@randysim
Copy link
Collaborator

Supabase generally returns an array of data, even if you're using a unique identifier such as an id to look for an object. I'm an idiot and instead of doing things the right way I just took out the first element of the array.

https://supabase.com/docs/reference/javascript/single

but you could use .limit(1) and .single to make the code cleaner

This would save lines of code and make it slightly more optimized! just a peeve right now.

@randysim randysim added good first issue Good for newcomers refactor refactor code labels Jun 29, 2024
@randysim randysim assigned randysim and unassigned randysim Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers refactor refactor code
Projects
None yet
Development

No branches or pull requests

1 participant