3398411: Adds support for update resource method in json api client
2 unresolved threads
Merge request reports
Activity
Filter activity
added 5 commits
-
a2b16016...a019046a - 3 commits from branch
project:canary
- bb6a6c89 - 3398411: Adds update resource method.
- fdae3a58 - 3398411: Adds unit test for JSON:API update operation.
-
a2b16016...a019046a - 3 commits from branch
added 1 commit
- e68f8681 - 3398411: Add require header for patch request.
- Resolved by Pratik Kamble
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, changed this line in version 4 of the diff
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> { Rather than returning a boolean, I think it might be more useful to return the data from the response. Upon success this is the newly updated resource - that could open up some interesting opportunities to do things like update the cache for this entity. And in the case of unsuccessful responses, the data includes some information about the error.
changed this line in version 4 of the diff
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.
Toggle commit list-
dbec6a22 - 1 commit from branch
added 1 commit
- c49fa25b - 3398411: Updated doc block for updateResource.
- Resolved by Coby Sher
added 1 commit
- 287e5285 - 3398411: Adds changeset for supporting update of resource in jsonapiclient.
Please register or sign in to reply