Skip to content

Conversation

@ZSnake
Copy link
Contributor

@ZSnake ZSnake commented Sep 25, 2024

  • Update the following mutating functions to return the API call response body instead of resolving an empty promise:
    • createOrReplaceItems
    • updateItems
    • deleteItems
    • createOrReplaceVariations
    • updateVariations
    • deleteVariations
  • Fix broken tests related to getBrowseResults and Facet Configurations cleanup hook

…n the API call response body instead of resolving an empty promise
@jjl014 jjl014 requested a review from a team September 25, 2024 23:35
Copy link
Contributor

@Mudaafi Mudaafi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good. Thanks for fixing the tests. Let's also update the types in catalog.d.ts before we merge this in.

signal,
});

const body = await response.json();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets move this within the conditional if (response.ok) {. If we return an error, it might not be in json so we'll resolve a json-parse error instead of the http error on line 264. Besides, that's the only place we're using body anyways.

@ZSnake ZSnake requested a review from Mudaafi October 3, 2024 15:52
Copy link
Contributor

@Mudaafi Mudaafi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. let's get a second review since this touches a lot of methods

@Mudaafi Mudaafi requested a review from a team October 3, 2024 17:05
Copy link
Contributor

@stanlp1 stanlp1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@esezen esezen merged commit e8707b3 into master Dec 23, 2024
@esezen esezen deleted the CI-3858-update-items-apis-return-values branch December 23, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants