ajones05 / seearound.me-ionic

0 stars 0 forks source link

Need two filter params for new design #241

Closed abdulhafeez closed 6 years ago

abdulhafeez commented 7 years ago

@yuriyua Andrew has given me a new design where there are two different fields to select filters as shown in the screen shot below: filter

This means, we will need two different filter params on mobile/request-nearest and mobile/myposts APIs. Earlier, we had filter param which took values 0,1,2,3 and 4. Now we need two params where one takes values 0,1 or 2 and the other takes 0, 3 or 4. The APIs should now return results depending upon the values of two filters together.

yuriyua commented 7 years ago

ok, I will start work on this task today

yuriyua commented 7 years ago

I made the filter values multiple.

https://github.com/ajones05/seearound.me/wiki/Mobile-Api-Reference/_compare/6211f94149e51a4cfc1f41309d8439b1e482db63...73bc50ba5b56132468d29755836a8f7c56c328e7

Popular filter required for all requests except Most recent

'' => 'Most interesting',
'0' => 'My posts',
'1' => 'My interests',
'2' => 'Following'
'3' => 'Most recent',

values 0,1 or 2

https://www.seearound.me/admin/mobile-api/myposts/token/XSA5L8IA2ZDG42AG8NDHNFL5HPXMV1NRS1YF9HRBG6SL755FTH1HZLNHCL68LV2F/?filter[]=0 or https://www.seearound.me/admin/mobile-api/myposts/token/XSA5L8IA2ZDG42AG8NDHNFL5HPXMV1NRS1YF9HRBG6SL755FTH1HZLNHCL68LV2F/?filter[]=1

0, 3 or 4

https://www.seearound.me/admin/mobile-api/myposts/token/XSA5L8IA2ZDG42AG8NDHNFL5HPXMV1NRS1YF9HRBG6SL755FTH1HZLNHCL68LV2F/?filter[]=2

0 and 4

Will we combine filter parameters: Most interesting and Most recent?

abdulhafeez commented 7 years ago

I am not clear on what parameters I should send for different combinations of filters. According to design, we want the following combinations:

  1. Sorted by most recent and popular, from every one (default)
  2. Sorted by most recent, from every one
  3. Sorted by most popular, from every one
  4. Sorted by most recent and popular, from people I follow
  5. Sorted by most recent, from people I follow
  6. Sorted by most popular, from people I follow
  7. Sorted by most recent and popular, from me
  8. Sorted by most recent, from me
  9. Sorted by most popular, from me

Can you place numbers (two numbers) against each combination which I should pass to get the desired results?

ajones05 commented 6 years ago

@yuriyua can you clarify?

yuriyua commented 6 years ago

yes, I will start work on these updates today

yuriyua commented 6 years ago

@abdulhafeez done

Sorted by most recent and popular, from every one (default)

https://www.seearound.me/admin/mobile-api/myposts/token/DPQSK1XN61L5CZ1388KK45I149ME2FVE7L9RM6GS74ZI4ZMB89XBDGBGQ1YSFT9M/submit/1/?filter[]=3&filter[]=4

Sorted by most recent, from every one

https://www.seearound.me/admin/mobile-api/myposts/token/DPQSK1XN61L5CZ1388KK45I149ME2FVE7L9RM6GS74ZI4ZMB89XBDGBGQ1YSFT9M/submit/1/?filter[]=3

Sorted by most popular, from every one

https://www.seearound.me/admin/mobile-api/myposts/token/DPQSK1XN61L5CZ1388KK45I149ME2FVE7L9RM6GS74ZI4ZMB89XBDGBGQ1YSFT9M/submit/1/?filter[]=4

Sorted by most recent and popular, from people I follow

https://www.seearound.me/admin/mobile-api/myposts/token/DPQSK1XN61L5CZ1388KK45I149ME2FVE7L9RM6GS74ZI4ZMB89XBDGBGQ1YSFT9M/submit/1/?filter[]=2&filter[]=3&filter[]=4

Sorted by most recent, from people I follow

https://www.seearound.me/admin/mobile-api/myposts/token/DPQSK1XN61L5CZ1388KK45I149ME2FVE7L9RM6GS74ZI4ZMB89XBDGBGQ1YSFT9M/submit/1/?filter[]=2&filter[]=3

Sorted by most popular, from people I follow

https://www.seearound.me/admin/mobile-api/myposts/token/DPQSK1XN61L5CZ1388KK45I149ME2FVE7L9RM6GS74ZI4ZMB89XBDGBGQ1YSFT9M/submit/1/?filter[]=2&filter[]=4

Sorted by most recent and popular, from me

https://www.seearound.me/admin/mobile-api/myposts/token/DPQSK1XN61L5CZ1388KK45I149ME2FVE7L9RM6GS74ZI4ZMB89XBDGBGQ1YSFT9M/submit/1/?filter[]=0&filter[]=3&filter[]=4

Sorted by most recent, from me

https://www.seearound.me/admin/mobile-api/myposts/token/DPQSK1XN61L5CZ1388KK45I149ME2FVE7L9RM6GS74ZI4ZMB89XBDGBGQ1YSFT9M/submit/1/?filter[]=0&filter[]=3

Sorted by most popular, from me

https://www.seearound.me/admin/mobile-api/myposts/token/DPQSK1XN61L5CZ1388KK45I149ME2FVE7L9RM6GS74ZI4ZMB89XBDGBGQ1YSFT9M/submit/1/?filter[]=0&filter[]=4

yuriyua commented 6 years ago

@abdulhafeez or we can add new filter parameter for send single filter option 1-9 Please test and let me know how it would be better for you

abdulhafeez commented 6 years ago

@yuriyua What you have done is fine. I have implemented it accordingly.