Closed emilasuska closed 3 months ago
In terms of security. The user_id field is currently acting as a template which should be parsed from an authorization token (the method should fail if that isn't valid. That wasn't in our PR but we were assuming @MNThomson was going to add that when setting up the JWT token stuff.
As far as errors and PGSync, we're sticking to the working implementation based on our agreement for Sprint 2 to implement a minimum viable product, but for Sprint 3 it's a great idea.
Description
This is a PR implementing search reindex API post, patch, and delete methods and their corresponding tests.
It includes completing:
All of these API endpoints with backend:
/api/search/reindex/listing-created
/api/search/reindex/listing-edited
/api/search/reindex/listing-deleted
Integration tests using a test-index which is initialized before each test and destroyed after each test. All tests use the elasticsearch endpoint.
Closes #70
How to Test
Checkout this branch
In a terminal, navigate to the martletplace directory and run
docker-compose up --build
Wait a minute for the data layer (particularly elasticsearch) to get ready for input
In a terminal, run
docker exec -it martletplace_search bash
In the bash terminal, run
pytest src/test_server.py
How to manually test:
Uncomment this port in
docker-compose.yml
Build the container
Wait a minute for the data layer (particularly elasticsearch) to get ready for input
In a browser, navigate to localhost:8221/docs
Play with the reindexing endpoints and search endpoint there by creating listings, searching for them based on different parameters, and deleting them
Checklist