Commit Graph

8 Commits

Author SHA1 Message Date
Aaron William Po
0d3785ad1a Add environment variable validation and parsing
Adds a validation schema for the application's environment variables using the Zod library. The parsed environment variables are then exported as constants that can be imported throughout the application, replacing the direct use of process.env.
2023-04-07 11:37:30 -04:00
Aaron William Po
a4362a531c Add custom hooks for time distance and retrieving like count
Documentation added to all custom hooks
2023-04-03 23:32:32 -04:00
Aaron William Po
de3964dbfa Rewrote beer by id page comments to load on client 2023-04-02 21:50:42 -04:00
Aaron William Po
b69dbc95b4 Work on brewery page, refactors
Refactor query types to explicitly use z.infer
2023-03-31 21:13:35 -04:00
Aaron William Po
2efc506250 Add beer search feature
This commit adds the necessary components and hooks to implement a beer search feature on the website. It includes the following changes:

- Add a new BeerSearch API route that returns a list of beers matching a search query.
-  Implement a new hook useBeerPostSearch that utilizes SWR to fetch data from the API and parse it using a schema.
- Add a new page SearchPage that displays a search input field and a list of beer search results.
- Use lodash's debounce function to avoid making too many requests while the user is typing in the search input field.
2023-03-27 19:02:03 -04:00
Aaron William Po
472ead9abd Refactoring beer by id page, add delete comment
Refactored the comments ui into various new components, added the delete beer comment by id feature.
2023-03-03 21:28:44 -05:00
Aaron William Po
7126c74d5d Add edit beer post, 500 page, and redirectIfLoggedIn getServerSideProps.
Implement edit beer post functionality.

Register, edit and create beer post forms are now using the same layout found in components/ui/forms/BeerPostFormPageLayout. All forms are now extracted into their own components and are now found in components.

Added redirectIfLoggedIn getServerSidesProp fn for login and register pages.
2023-02-27 18:19:58 -05:00
Aaron William Po
11b3304c54 Update page auth HOF type definitions
Added vercel config, update packages
2023-02-25 19:17:49 -05:00