fix(private-room): preserve payment return route
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { PayChannel } from "@/data/dto/payment";
|
||||
import type { AppSubscriptionReturnTo } from "@/router/navigation-types";
|
||||
|
||||
export type PaymentSearchParamValue = string | string[] | undefined;
|
||||
export type PaymentSearchParams = Record<string, PaymentSearchParamValue>;
|
||||
@@ -21,6 +22,14 @@ export function parsePaymentPayChannel(
|
||||
return channel === "ezpay" || channel === "stripe" ? channel : null;
|
||||
}
|
||||
|
||||
export function parseSubscriptionReturnTo(
|
||||
value: PaymentSearchParamValue,
|
||||
): AppSubscriptionReturnTo {
|
||||
const returnTo = getFirstPaymentSearchParam(value);
|
||||
if (returnTo === "chat" || returnTo === "private-room") return returnTo;
|
||||
return null;
|
||||
}
|
||||
|
||||
export function parsePaymentReturnSearchParams(
|
||||
searchParams: PaymentSearchParams,
|
||||
): PaymentReturnSearchParams {
|
||||
|
||||
Reference in New Issue
Block a user