Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GET | /search #21

Closed
3 tasks done
Israa91 opened this issue Feb 1, 2021 · 0 comments · Fixed by #80
Closed
3 tasks done

GET | /search #21

Israa91 opened this issue Feb 1, 2021 · 0 comments · Fixed by #80
Assignees
Labels

Comments

@Israa91
Copy link
Collaborator

Israa91 commented Feb 1, 2021

Issues Template

relates #5

Route: GET api/v1/search?q=&location=&minPrice=&maxPrice=&rating=&maxResults

Acceptance Criteria

  • DB query
  • Response
  • Testing

DB query

SELECT 
kindergarten.kindergarten_name,kindergarten.cover_image,kindergarten.description, 
kindergarten.phone_number,kindergarten.min_price,kindergarten.max_price,
kindergarten.periods,kindergarten.images_gallery,location.location_name,
comments.comment ,comments.rating
FROM 
kindergarten ,location,comments
WHERE
kindergarten_name = q OR min_price = min_price OR max_price=max_price OR location 
IN
(SELECT location_name FROM location WHERE kindergarten.location_id =location.location_id ) OR rating
IN
(SELECT rating FROM comments WHERE kindergarten.kindergarten_id = comments.kindergarten_id);

Response

  • Success
{ StatusCode: 200,
  data: [{
          id,
          kindergarten_name,
          cover_image,
          description,
          phone_number,
          latitude,ND
          longitude,
          min_price,
          max_price,
          periods,
          images_gallery,
          create_at
        }]
}

ND

  • Failed
{statusCode:400, message:"Bad Request"}

Testing

to be a successful test

  • status === 200
  • typeof(data) === "array"
  • data.length !== 0
@Israa91 Israa91 added the Backend label Feb 1, 2021
Osama-you added a commit that referenced this issue Feb 9, 2021
Osama-you added a commit that referenced this issue Feb 9, 2021
@Osama-you Osama-you linked a pull request Feb 9, 2021 that will close this issue
Osama-you added a commit that referenced this issue Feb 9, 2021
Osama-you added a commit that referenced this issue Feb 9, 2021
Osama-you added a commit that referenced this issue Feb 9, 2021
Osama-you added a commit that referenced this issue Feb 10, 2021
Osama-you added a commit that referenced this issue Feb 10, 2021
Osama-you added a commit that referenced this issue Feb 10, 2021
Osama-you added a commit that referenced this issue Feb 10, 2021
Osama-you added a commit that referenced this issue Feb 10, 2021
Osama-you added a commit that referenced this issue Feb 10, 2021
Osama-you added a commit that referenced this issue Feb 10, 2021
Osama-you added a commit that referenced this issue Feb 10, 2021
Osama-you added a commit that referenced this issue Feb 10, 2021
Osama-you added a commit that referenced this issue Feb 10, 2021
Osama-you added a commit that referenced this issue Feb 10, 2021
Osama-you added a commit that referenced this issue Feb 10, 2021
Osama-you added a commit that referenced this issue Feb 10, 2021
Osama-you added a commit that referenced this issue Feb 10, 2021
Osama-you added a commit that referenced this issue Feb 10, 2021
Osama-you added a commit that referenced this issue Feb 11, 2021
Osama-you added a commit that referenced this issue Feb 11, 2021
Relates #21
Osama-you added a commit that referenced this issue Feb 11, 2021
Osama-you added a commit that referenced this issue Feb 11, 2021
Osama-you added a commit that referenced this issue Feb 13, 2021
Osama-you added a commit that referenced this issue Feb 13, 2021
Relates #21
Alaalser pushed a commit that referenced this issue Feb 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants