Created browser history for logged out users and logged in users. Logged out users have browser history stored in the BrowserHistory Context, and logged in users have browser history stored in the backend. Logging in after being logged out will merge all previous browser history stored in local storage into the user's account.
**NOTE: merging will add productIds with the timestamp the user logs in with, although there is a separate timestamp stored in local context. this is bc i forgot to implement the POST endpoint to take in a timestamp query.... will fix later
Backend
Created new browser history table inside of member folder for each member's browsing history
Added 3 new endpoints for /account:
POST /{memberId}/browser-history/{productId} adds a productId and timestamp to history table with member's id
GET /{memberId}/browser-history gets all products viewed with member's id
DELETE /{memberId}/browser-history deletes all products before a timestamp query under member's id
** All these endpoints are in graphql member folder as:
addBrowserHistory
getBrowserHistory
deleteBrowserHistory
Frontend
Created browsing history category that updates based on browsing history
Created browser history for logged out users and logged in users. Logged out users have browser history stored in the BrowserHistory Context, and logged in users have browser history stored in the backend. Logging in after being logged out will merge all previous browser history stored in local storage into the user's account.
**NOTE: merging will add productIds with the timestamp the user logs in with, although there is a separate timestamp stored in local context. this is bc i forgot to implement the POST endpoint to take in a timestamp query.... will fix later
Backend
** All these endpoints are in graphql member folder as:
Frontend