Open damianmarti opened 6 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
collectivedaoarchives-catalog | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Feb 27, 2024 10:27am |
Hey @damianmarti ,
now the ones that show first, are the ones that don't have a Date:
Hey @damianmarti ,
now the ones that show first, are the ones that don't have a Date:
Thanks @carletex
Now I'm filtering the records with date not null.
Hey @damianmarti thanks for this!
I see one «problem» when filtering out the ones without a date: the /records
page uses the same endpoint
This is off because of it: (total count still gets ALL the records)
Not sure if this is a big deal, but just mentioning it here.
I remember tweaking the search
query for this same reason, but it was rawSQL: "date-desc": Prisma.sql
CASE WHEN date IS NULL THEN 1 ELSE 0 END, "date" DESC,
What do you think?
Hey @damianmarti thanks for this!
I see one «problem» when filtering out the ones without a date: the
/records
page uses the same endpointThis is off because of it: (total count still gets ALL the records)
Not sure if this is a big deal, but just mentioning it here.
I remember tweaking the
search
query for this same reason, but it was rawSQL:"date-desc": Prisma.sql
CASE WHEN date IS NULL THEN 1 ELSE 0 END, "date" DESC,
What do you think?
Thanks!! I thought it was not used in another place. Let me check for a better solution.
@carletex please take a look now. I created a new backend endpoint for the home records, so we can do whatever we want to the records shown on the home page and not affect the rest of the site. Thanks and sorry for the previous issues!
@carletex please take a look now. I created a new backend endpoint for the home records, so we can do whatever we want to the records shown on the home page and not affect the rest of the site. Thanks and sorry for the previous issues!
This still has the same problem on the /records page, since we are filtering out the records with no dates (and pagination is off because off it too)
Let me try to come up with a solution!
@damianmarti so I added this: https://github.com/amy-jung/collectivedaoarchives.catalog/pull/70/commits/80fcb74dce710768db6eecdbb900ec0ba176d525
It's a raw query so we can order elements with no date at the end and everything keeps working the same.
tsvector
from the text search was giving errors."
to some fields, because if not it wasn't case sensitive :man_shrugging: Let me know what you think. Thanks!!
@carletex Oh, no, sorry! I forgot to push the changes to records.ts, to leave it at it was before, so the change only affects the home page!
Your change looks good, I was trying to avoid using raw SQL to keep it simple.
We can go with your change or we can add again the backend endpoint for the home page, but keeping the records endpoint as it was before. Please let me know what you prefer. Thanks!!
We can go with your change or we can add again the backend endpoint for the home page, but keeping the records endpoint as it was before. Please let me know what you prefer. Thanks!!
The only PRO I see of doing the raw SQL is that we are also sorting by date DESC correctly on the /records
page. If we don't need that, let's use the homepage endpoint.
Let's ask @amy-jung !!
Amy, do we want to sort by date DESC the /records
page, or just the homepage?
Thanks all! <3
Sorry what is DESC?
Ideally we would just have both! (Assuming when you search, the default is by closest to search, then by date)
Sorry what is DESC?
Ideally we would just have both! (Assuming when you search, the default is by closest to search, then by date)
It means the most recent record first. We can show the most recent records on the home page and with the same ordering on the records page too. Is it ok for you?
closes #68