Skip to content

Commit

Permalink
adding a fallback to OpenExternalLinkResponse for older clients
Browse files Browse the repository at this point in the history
  • Loading branch information
HamzaAtDiscord committed Nov 18, 2024
1 parent 73a6285 commit 24b227d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/schema/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
ChannelTypesObject,
ReceiveFramePayload,
} from './common';
import {zodCoerceUnhandledValue} from '../utils/zodUtils';
import {fallbackToDefault, zodCoerceUnhandledValue} from '../utils/zodUtils';
import {Schemas, AuthenticateResponseSchema, InitiateImageUploadResponseSchema} from '../generated/schemas';
import assertUnreachable from '../utils/assertUnreachable';

Expand Down Expand Up @@ -106,9 +106,9 @@ export const GetChannelPermissionsResponse = zod.object({
permissions: zod.bigint().or(zod.string()),
});

export const OpenExternalLinkResponse = zod.object({
export const OpenExternalLinkResponse = fallbackToDefault(zod.object({

Check failure on line 109 in src/schema/responses.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `zod` with `⏎··zod⏎····`
opened: zod.boolean(),

Check failure on line 110 in src/schema/responses.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `····`
});
}).default({opened: null}));

Check failure on line 111 in src/schema/responses.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `}).default({opened:·null})` with `····})⏎····.default({opened:·null}),⏎`

Check failure on line 111 in src/schema/responses.ts

View workflow job for this annotation

GitHub Actions / tsc

No overload matches this call.

export {InitiateImageUploadResponseSchema as InitiateImageUploadResponse};

Expand Down

0 comments on commit 24b227d

Please sign in to comment.