Nathan
11/29/2021, 8:24 PMt
is not possible. (throws error)
For better context, what I am trying to do is use my URL params to create a select query. For example, /inventory?make=Nissan&model=Maxima&year=2018,2021
.
I'm currently passing my URL params as an object into match()
. This works perfectly until I have a range in the params, such as year=2018,2021
. This will not work. Obviously I need to use the filter methods for the ranges.
And this here lies the problem .. or inconvenience. I'm going to have to write multiple IF statements for each possible combination of ranges. (year
, price
, & miles
).
Thoughts on possibilities? Thanks!garyaustin
11/29/2021, 8:33 PMgaryaustin
11/29/2021, 8:37 PMNathan
11/29/2021, 8:39 PMgaryaustin
11/29/2021, 8:40 PMNathan
11/29/2021, 8:43 PMgaryaustin
11/29/2021, 8:43 PMNathan
11/29/2021, 8:43 PMUncaught (in promise) TypeError: query.gte is not a function
garyaustin
11/29/2021, 8:43 PMgaryaustin
11/29/2021, 8:43 PMNathan
11/29/2021, 8:44 PMNathan
11/29/2021, 8:44 PMgaryaustin
11/29/2021, 8:46 PMNathan
11/29/2021, 8:47 PMgaryaustin
11/29/2021, 8:49 PM%${filter.val.toLowerCase()}%
)
break
case "between":
query = query.gte(filter.col, filter.val[0])
query = query.lte(filter.col, filter.val[1])
}
})
query = query.order(orderObj.column,{ascending:orderObj.ascending}).range(startRecord,startRecord+qLimit-1)
let { data: notes, error,count } = await querygaryaustin
11/29/2021, 8:50 PMNathan
11/29/2021, 8:50 PMgaryaustin
11/29/2021, 8:51 PMNathan
11/29/2021, 8:52 PMsupabase.from(table)
assignment? That's odd just looking at it ...garyaustin
11/29/2021, 8:52 PMgaryaustin
11/29/2021, 8:53 PMNathan
11/29/2021, 8:54 PMNathan
11/29/2021, 8:54 PMNathan
11/29/2021, 8:55 PMsupabase
?Nathan
11/29/2021, 8:56 PMconst supabase = createClient('host', 'token')
?garyaustin
11/29/2021, 8:56 PMNathan
11/29/2021, 8:56 PMNathan
11/29/2021, 8:56 PMgaryaustin
11/29/2021, 8:59 PMgaryaustin
11/29/2021, 9:01 PMgaryaustin
11/29/2021, 9:01 PMNathan
11/29/2021, 9:04 PMNathan
11/29/2021, 9:04 PMgaryaustin
11/29/2021, 9:06 PMNathan
11/29/2021, 9:58 PManothercoder
11/30/2021, 1:55 AM