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

    Function updateResource

    • Update an existing resource (full replacement)

      Sends a PUT request to replace an existing resource entirely. Use PATCH (patchResource) for partial updates.

      Type Parameters

      • TInput

        Type of the input data

      • TOutput

        Type of the response data

      Parameters

      • url: string

        API endpoint URL including resource ID

      • data: TInput

        Complete resource data

      Returns Promise<TOutput>

      Promise resolving to the updated resource

      const user = await updateResource<UserInput, User>('/api/users/123', {
      name: 'Jane Doe',
      email: 'jane@example.com'
      });