Skip to content

Conversation

@alikon
Copy link
Contributor

@alikon alikon commented Mar 25, 2020

Summary of Changes

added the option to filter users by:

  • active
  • state
  • search
  • groupid
  • registration date
  • last visit date

Testing Instructions

call JROOT_URL/api/index.php/v1/users?filter[groupid]=8
call JROOT_URL/api/index.php/v1/users?filter[lastVisitDateStart]=2020-01-29T20:36:01Z
call JROOT_URL/api/index.php/v1/users?filter[search]=myName
call JROOT_URL/api/index.php/v1/users?filter[state]=0
call JROOT_URL/api/index.php/v1/users?filter[active]=1
call JROOT_URL/api/index.php/v1/users?filter[registrationDateStart]=2018-01-29T20:36:01Z
call JROOT_URL/api/index.php/v1/users?filter[registrationDateEnd]=2020-01-29T20:36:01Z
or any combination like :
JROOT_URL/api/index.php/v1/users?filter[groupid]=8&filter[state]=0
etc

Expected values for registrationDateStart , registrationDateEnd and lastVisitDateStart,lastVisitDateEnd are:

2020-03-29T20:36:01Z
2020-03-29T20:36:01+00:00

Expected result

the api response is filtered

Actual result

N/A

Documentation Changes Required

yes

alikon added 2 commits March 26, 2020 09:37
send a 400 response  if date filter value is unsupported
@Quy
Copy link
Contributor

Quy commented Mar 27, 2020

I have tested this item ✅ successfully on 893d051


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28451.

@Razzo1987
Copy link
Contributor

Razzo1987 commented Apr 9, 2020

I have tested this item 🔴 unsuccessfully on 893d051

{{base_path}}/api/index.php/v1/users?filter[status]=1
{{base_path}}/api/index.php/v1/users?filter[status]=0

return the same list of users

{{base_path}}/api/index.php/v1/users?users?filter[registrationdate]=never

returns a list of users who have the registration date

immagine

Same list of 3 users is given from
{{base_path}}/api/index.php/v1/users?users?filter[lastvisitdate]=never


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28451.

@Quy
Copy link
Contributor

Quy commented Apr 9, 2020

The example is incorrect. [status] should be [state].

@Quy
Copy link
Contributor

Quy commented Apr 9, 2020

See comment in testing instructions:

never (make sense only for lastvisitdate)

@alikon
Copy link
Contributor Author

alikon commented Apr 9, 2020

thanks @Quy updated the Testing Instructions

@Quy
Copy link
Contributor

Quy commented Apr 9, 2020

JROOT_URL/api/index.php/v1/users?filter[groupid]=system&filter[status]=0

This too please.

@Quy
Copy link
Contributor

Quy commented Apr 9, 2020

filter[groupid]=system

Should be integer.

@Razzo1987
Copy link
Contributor

I have tested this item ✅ successfully on 893d051

re tested. it works!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28451.

@alikon alikon changed the title [4.0][api][com_users] - Add filter options [4.0][api][com_users] - Add filter options Apr 9, 2020
@alikon
Copy link
Contributor Author

alikon commented Apr 9, 2020

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28451.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Apr 9, 2020
@alikon alikon removed the RTC This Pull Request is Ready To Commit label Apr 11, 2020
@alikon
Copy link
Contributor Author

alikon commented Apr 11, 2020

this needs to be retested
cause we have now differnt and better filter for: registrationDate/lastVisitDate

  • registrationDateStart
  • registrationDateEnd
  • lastVisitDateStart
  • lastVisitDateEnd

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Apr 11, 2020
@alikon alikon removed the RTC This Pull Request is Ready To Commit label Apr 11, 2020
@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Apr 11, 2020
@alikon alikon removed the RTC This Pull Request is Ready To Commit label Apr 11, 2020
@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Apr 12, 2020
@Quy Quy removed the RTC This Pull Request is Ready To Commit label Apr 12, 2020
@Razzo1987
Copy link
Contributor

Razzo1987 commented Apr 18, 2020

I have tested this item 🔴 unsuccessfully on c11fd11

Start & End inverted ;)

This example output the users:
{{base_path}}/api/index.php/v1/users?filter[lastVisitDateEnd]=2010-04-18T14:52:20Z&filter[lastVisitDateStart]=2050-04-18T14:52:20Z
If we have Start < End doesn't :(


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28451.

@faustonenci
Copy link

I have tested this item 🔴 unsuccessfully on c11fd11

not work

JROOT_URL/api/index.php/v1/users?filter[lastVisitDateStart]=2020-01-29T20:36:01Z

work if
inverted Date with Start

JROOT_URL/api/index.php/v1/users?filter[lastVisitStartDate]=2020-01-29T20:36:01Z

idem for
JROOT_URL/api/index.php/v1/users?filter[registrationDateStart]=2018-01-29T20:36:01Z
JROOT_URL/api/index.php/v1/users?filter[registrationDateEnd]=2020-01-29T20:36:01Z


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28451.

@alikon
Copy link
Contributor Author

alikon commented Apr 18, 2020

we have had a live debug sesion with the help of @Razzo1987
now should be fixed
please retest @Razzo1987

@faustonenci
Copy link

I have tested this item ✅ successfully on 8e1c0e5

good !


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28451.

@Razzo1987
Copy link
Contributor

I have tested this item ✅ successfully on 8e1c0e5

Now Start & End works correctly.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28451.

@richard67
Copy link
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28451.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Apr 19, 2020
@wilsonge wilsonge merged commit f0079c5 into joomla:4.0-dev Apr 19, 2020
@wilsonge
Copy link
Contributor

Thanks!

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Apr 19, 2020
@wilsonge wilsonge added this to the Joomla 4.0 milestone Apr 19, 2020
@alikon alikon deleted the patch-112 branch April 19, 2020 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants