diff --git a/apps/api/src/app/subscription/subscription.service.ts b/apps/api/src/app/subscription/subscription.service.ts index 143f89950b..17beba0077 100644 --- a/apps/api/src/app/subscription/subscription.service.ts +++ b/apps/api/src/app/subscription/subscription.service.ts @@ -23,8 +23,6 @@ import { addMilliseconds, isBefore } from 'date-fns'; import ms, { StringValue } from 'ms'; import Stripe from 'stripe'; -import { StringLiteral } from './types/string-literal.type'; - @Injectable() export class SubscriptionService { private readonly logger = new Logger(SubscriptionService.name); @@ -270,7 +268,11 @@ export class SubscriptionService { const unsupportedLanguageCodes: Record< Exclude< (typeof SUPPORTED_LANGUAGE_CODES)[number], - StringLiteral + // Extract removes OtherString of Stripe, which matches every string + Extract< + Stripe.Checkout.SessionCreateParams.Locale, + (typeof SUPPORTED_LANGUAGE_CODES)[number] + > >, true > = { diff --git a/apps/api/src/app/subscription/types/string-literal.type.ts b/apps/api/src/app/subscription/types/string-literal.type.ts deleted file mode 100644 index 1f25cb81a4..0000000000 --- a/apps/api/src/app/subscription/types/string-literal.type.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Removes the open string type (e.g. OtherString of Stripe), which matches -// every string, and keeps only the string literals -export type StringLiteral = T extends string - ? string extends T - ? never - : T - : never;