ndswimming92 / noteworthy-fe-capstone

Notetaking app in react
1 stars 0 forks source link

Create New Note #11

Open ndswimming92 opened 7 months ago

ndswimming92 commented 7 months ago

User Story - what the user should see and experience

Acceptance Criteria - illustrates the scope of the individual ticket

When the user submits the note, the app sends a POST request to the server with the new note's data. The server processes the request, validates the data, and stores the new note in the database with a unique identifier (ID). The app receives a success response from the server, and the new note is added to the list of notes on the home page.

Example -

NW2

Dependencies -

Dev Notes - dev work that needs to be completed for this ticket

const createMember = (payload) => new Promise((resolve, reject) => {
  fetch(`${endpoint}/member.json`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(payload),
  })
    .then((response) => response.json())
    .then((data) => resolve(data))
    .catch(reject);
});