Skip to content

Commit c937990

Browse files
committed
chore(backend): Warn about backend api return format deprecation
Currently the return value is the response.body `data` or throws a ClerkAPIResponseError error with the response.body `errors`
1 parent f500d46 commit c937990

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/backend/src/api/request.ts

+5
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ type LegacyRequestFunction = <T>(requestOptions: ClerkBackendApiRequestOptions)
5151
const withLegacyReturn =
5252
(cb: any): LegacyRequestFunction =>
5353
async (...args) => {
54+
deprecated(
55+
'',
56+
'Resources return format will switch to `{ data: any, errors: ClerkAPIError[] }` from `data | never` the next major version.',
57+
'resources-legacy-return',
58+
);
5459
// @ts-ignore
5560
const { data, errors, status, statusText } = await cb<T>(...args);
5661
if (errors === null) {

0 commit comments

Comments
 (0)