Files
calendar/packages/app-store/_utils/oauth/AxiosLikeResponseToFetchResponse.ts
T
d47c6b3fdb fix: Credential Syncing Improvements (#14588)
* Add example app to test credential sync

* Fixes

* Changes to normalize flow of GoogleCalendar and Zoom

* Add unit tests

* PR Feedback

* credential-sync-more-tests-and-more-apps

* Fix yarn.lock

* Clear cache

* Add test

* Fix yarn.lock

* Fix 204 handling

* Fix yarn.lock

---------

Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
2024-04-25 12:47:17 -04:00

23 lines
552 B
TypeScript

/**
* This class is used to convert axios like response to fetch response
*/
export class AxiosLikeResponseToFetchResponse<
T extends {
status: number;
statusText: string;
data: unknown;
}
> extends Response {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
body: any;
constructor(axiomResponse: T) {
super(JSON.stringify(axiomResponse.data), {
status: axiomResponse.status,
statusText: axiomResponse.statusText,
});
}
async json() {
return super.json() as unknown as T["data"];
}
}