Write Data

Learn how to add functionalities to the components to write data to the database.

We'll cover the following...

In this lesson, we are going to add functionality to the <NewBlogPost /> component at services/web/src/components/new-blog-post.svelte. The requirements we want to meet are:

  • Disable the Publish button until a title and content are available. (We did this in the previous lesson).
  • Show an error message when either the title or content is empty.
  • Show a success message when a new blog post is persisted in the database and empty the form fields.

We are going to tackle these requirements in the order ...