ResistanceCalendar / resistance-calendar-frontend

A central listing of upcoming progressive events
https://resistance-calendar-staging.herokuapp.com/
MIT License
7 stars 8 forks source link

Can't search for text string and enter date #95

Closed pdw207 closed 7 years ago

pfarnach commented 7 years ago

This is related to a bug in the ODATA library we're using on the backend. @aaghevli submitted a PR to them, but I'm not sure if it's been accepted yet.

aaghevli commented 7 years ago

That is correct @pfarnach and @pdw207. I can probably just publish my own npm artifact and use that in RCAPI since I don't think we will get the PR accepted anytime soon.

InciteDemocracy commented 7 years ago

We need to be able to search while filtering by both location and time simultaneously. Currently we seem to be able to search while filtering for location but not time.

aaghevli commented 7 years ago

That bug has been fixed by me publishing my own fix to npm. Has this been attempted again? I am oway on vacation so can check, but this should be fixed

pfarnach commented 7 years ago

@aaghevli I just checked and it seems like this isn't working. The call below returns an event that's before the selected starting date

https://resistance-calendar.herokuapp.com/v1/events?page=0&per_page=25&$orderby=start_date%20desc&$filter=contains(title,%20%27ngozi%27)%20or%20contains(name,%20%27ngozi%27)%20or%20contains(description,%20%27ngozi%27)%20and%20start_date%20gt%202017-05-12

Does the query look right?

aaghevli commented 7 years ago

I think you want an additional parens around the text clause?

This returns nothing:

https://resistance-calendar.herokuapp.com/v1/events?page=0&per_page=25&$orderby=start_date%20desc&$filter=(contains(title,%20%27ngozi%27)%20or%20contains(name,%20%27ngozi%27)%20or%20contains(description,%20%27ngozi%27))%20and%20start_date%20gt%202017-05-12

While the gt flipped to lt returns 2 events:

https://resistance-calendar.herokuapp.com/v1/events?page=0&per_page=25&$orderby=start_date%20desc&$filter=(contains(title,%20%27ngozi%27)%20or%20contains(name,%20%27ngozi%27)%20or%20contains(description,%20%27ngozi%27))%20and%20start_date%20lt%202017-05-12
pfarnach commented 7 years ago

Thanks, that solved two issues in one!

pfarnach commented 7 years ago

Resolved in https://github.com/ResistanceCalendar/resistance-calendar-frontend/pull/136

pfarnach commented 7 years ago

The PR hasn't been merged yet so I'm re-opening