Skip to content
Snippets Groups Projects

3398411: Adds support for update resource method in json api client

Open Pratik Kamble requested to merge issue/api_client-3398411:api_client-3398411 into canary
2 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 348 * If the update is successful (HTTP status 200), it returns true; otherwise, it returns false.
    349 *
    350 * @example
    351 * ```typescript
    352 * const success = await updateResource("node--page", "7cbb8b73-8bcb-4008-874e-2bd496bd419d");
    353 * if (success) {
    354 * console.log("Resource updated successfully.");
    355 * } else {
    356 * console.error("Failed to update resource.");
    357 * }
    358 * ```
    359 */
    360 async updateResource(
    361 type: EntityTypeWithBundle,
    362 resourceId: string,
    363 body: string | null,
  • 349 *
    350 * @example
    351 * ```typescript
    352 * const success = await updateResource("node--page", "7cbb8b73-8bcb-4008-874e-2bd496bd419d");
    353 * if (success) {
    354 * console.log("Resource updated successfully.");
    355 * } else {
    356 * console.error("Failed to update resource.");
    357 * }
    358 * ```
    359 */
    360 async updateResource(
    361 type: EntityTypeWithBundle,
    362 resourceId: string,
    363 body: string | null,
    364 ): Promise<boolean> {
  • Great start here - was able to get this up and running locally and it works well. Added a few thoughts inline about how I think we might be able to improve the API for this a bit.

  • Pratik Kamble added 6 commits

    added 6 commits

    • dbec6a22 - 1 commit from branch project:canary
    • e4b5d7e4 - 3398411: Adds update resource method.
    • 02ef8d99 - 3398411: Adds unit test for JSON:API update operation.
    • e447b15d - 3398411: Add require header for patch request.
    • 26684589 - 3398411: Return response in the updateResource.
    • fd6f45ce - 3398411: Updated doc block for updateResource.

    Compare with previous version

  • Pratik Kamble added 1 commit

    added 1 commit

    • c49fa25b - 3398411: Updated doc block for updateResource.

    Compare with previous version

  • Coby Sher
  • Pratik Kamble added 1 commit

    added 1 commit

    • 287e5285 - 3398411: Adds changeset for supporting update of resource in jsonapiclient.

    Compare with previous version

  • Coby Sher approved this merge request

    approved this merge request

  • Pratik Kamble started a merge train

    started a merge train

  • merged

  • Please register or sign in to reply
    Loading