Modern React Template - v0.0.10
    Preparing search index...

    Function createPost

    • Example: Create a new post

      Creates a new blog post with validation.

      Parameters

      • data: { content: string; title: string }

        Post data containing title and content

      Returns Promise<unknown>

      Promise resolving to the created post with server-generated fields

      If the request fails or validation fails

      const post = await createPost({
      title: 'My First Post',
      content: 'This is the content...'
      });
      console.log(post.id); // Server-generated UUID