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 13e5550
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 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({
opened: zod.boolean(),
});
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().or(zod.null()),

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}),⏎`

export {InitiateImageUploadResponseSchema as InitiateImageUploadResponse};

Expand Down

0 comments on commit 13e5550

Please sign in to comment.