feat(payment): sync plans and add coins rules
This commit is contained in:
@@ -15,7 +15,14 @@ import { Result } from "@/utils";
|
||||
|
||||
const paymentRepo: IPaymentRepository = paymentRepository;
|
||||
|
||||
export const loadPaymentPlansActor = fromPromise<PaymentPlansResponse>(
|
||||
export const loadCachedPaymentPlansActor =
|
||||
fromPromise<PaymentPlansResponse | null>(async () => {
|
||||
const result = await paymentRepo.getCachedPlans();
|
||||
if (Result.isErr(result)) throw result.error;
|
||||
return result.data;
|
||||
});
|
||||
|
||||
export const refreshPaymentPlansActor = fromPromise<PaymentPlansResponse>(
|
||||
async () => {
|
||||
const result = await paymentRepo.getPlans();
|
||||
if (Result.isErr(result)) throw result.error;
|
||||
|
||||
Reference in New Issue
Block a user