-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(people-provider): update PeopleApiClient photo method return type
Update PeopleApiClient.photo method to return PersonPhotoApiResponse instead of Blob since the IHttpClient interface has changed Adjust related types and methods to handle the updated return type Modify PersonController to map the API response to Blob and handle errors appropriately
- Loading branch information
Showing
6 changed files
with
60 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
'@equinor/fusion-framework-react-components-people-provider': minor | ||
'@equinor/fusion-framework-module-services': minor | ||
--- | ||
|
||
## @equinor/fusion-framework-module-services | ||
|
||
Updated the `PeopleApiClient.photo` method to properly type the response as `PersonPhotoApiResponse<TVersion>` instead of `Blob`. This allows for more accurate type checking when using the method. | ||
|
||
To update your code: | ||
|
||
- If you are using the `PeopleApiClient.photo` method directly, no changes are needed. The method will now properly type the response. | ||
- If you have custom type assertions or checks around the response from `PeopleApiClient.photo`, you may need to update them to handle `PersonPhotoApiResponse<TVersion>` instead of `Blob`. | ||
|
||
Example: | ||
|
||
```ts | ||
// Before | ||
const photoResponse: Blob = await peopleApiClient.photo( | ||
'v2', | ||
'blob', | ||
{ azureId: '123' } | ||
); | ||
console.log(typeof photoResponse); // Blob | ||
|
||
// After | ||
const photoResponse: PersonPhotoApiResponse<'v2'> = await peopleApiClient.photo( | ||
'v2', | ||
'blob', | ||
{ azureId: '123' } | ||
); | ||
console.log(typeof photoResponse); // Object - { filename: string, blob: Blob } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters