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

Solution for beehiiv Coding Challenge #1

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

philmillshub
Copy link
Owner

@philmillshub philmillshub commented Aug 6, 2023

These changes implement the API functions for creating and updating users in the database, using a PostgreSQL db to store entries, and it updates the front-end code to use these hooks.

  • Created a subscriber model to store subscriber information, with constraints on name (must exist), email (must exist, must be an email, must be unique regardless of case sensitivity), and status (must be active or inactive)
  • Updated create hook to check for valid input info and create the subscriber if so, and return a forbidden status if the save fails
  • Updated update hook to look up a subscriber and change its status, and return a not_found status if the lookup fails
  • Updated the front-end to take the results back from API calls to display results in the interface properly (with error handling)
  • Extended the test suite to cover as many cases as I could think of for this challenge

@philmillshub philmillshub changed the title Challenge update 3 Solution for beehiiv Coding Challenge Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant