refactor: rewrite useSubscription with RQ

This commit is contained in:
Rıdvan Akca
2024-03-13 14:42:29 +03:00
parent 89ad685f3a
commit 70b8817643
7 changed files with 46 additions and 57 deletions

View File

@@ -1,17 +0,0 @@
import appConfig from '../../config/app.js';
const getSubscriptionStatus = async (_parent, _params, context) => {
if (!appConfig.isCloud) return;
const currentSubscription = await context.currentUser.$relatedQuery(
'currentSubscription'
);
if (!currentSubscription?.cancellationEffectiveDate) return;
return {
cancellationEffectiveDate: currentSubscription.cancellationEffectiveDate,
};
};
export default getSubscriptionStatus;