Skip to content

Conversation

@tamnguyen976
Copy link

Summary

  • Added page src/pages/posts/new.jsx
  • Form posts data to backend POST /posts endpoint
  • Shows error message on 400 response ("Title cannot be blank")
  • Redirects to new post page on 201 Created

Testing Steps

  1. Start backend (port 5000).
  2. Start frontend:
    npm run dev
  3. Visit http://localhost:3000/posts/new
  4. Submit blank form → error message shown.
  5. Submit valid title + description → redirected to /posts/<slug>.

Notes

  • Requires .env.local with:
    DOTNET_SERVER_URL=http://localhost:5000
  • This PR completes frontend part of assignment step 3–4.

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