senaite / senaite.jsonapi

RESTful JSON API for SENAITE
https://www.senaite.com
GNU General Public License v2.0
11 stars 20 forks source link

jsonapi "Calculate_delta_date" issue #30

Open siyamalan opened 5 years ago

siyamalan commented 5 years ago

Steps to reproduce

I tried different request parameters "today, yesterday this-week, this-month this-year" to extract analysis request data

I entered below url "http://website-address/lims/@@API/senaite/v1/search?portal_type=AnalysisRequest&children=yes&recent_modified=today

Current behavior

Getting { "_runtime": 0.0014731884002685547, "message": "'module' object has no attribute 'calculate_delta_date'", "success": false }

Expected behavior

I should be getting data based on my request parameters as described in https://plonejsonapiroutes.readthedocs.io/en/latest/api.html. "recent_modified=today" request parameter is not working

Not sure if I should input "today" under recent_modified or something else

ramonski commented 5 years ago

Hello @siyamalan, this was previously fixed here: https://github.com/senaite/senaite.jsonapi/pull/26 Can you please use the latest master branch and confirm? Thanks

siyamalan commented 5 years ago

Thanks ramonksi I am getting what I am exactly expecting for http://localhost:8080/lims/@@API/senaite/v1/search?portal_type=AnalysisRequest&recent_created=today

values today, yesterday, this-month work fine. Today gives everything created today, Yesterday gives everything created yesterday and today this-month gives everything for entire month.

Noticed few more issues that senaite.jsonapi may not have anything to do with