feat: Convert all query files to JS
This commit is contained in:
19
packages/backend/src/graphql/queries/get-invoices.ee.js
Normal file
19
packages/backend/src/graphql/queries/get-invoices.ee.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import Billing from '../../helpers/billing/index.ee';
|
||||
|
||||
const getInvoices = async (_parent, _params, context) => {
|
||||
const subscription = await context.currentUser.$relatedQuery(
|
||||
'currentSubscription'
|
||||
);
|
||||
|
||||
if (!subscription) {
|
||||
return;
|
||||
}
|
||||
|
||||
const invoices = await Billing.paddleClient.getInvoices(
|
||||
Number(subscription.paddleSubscriptionId)
|
||||
);
|
||||
|
||||
return invoices;
|
||||
};
|
||||
|
||||
export default getInvoices;
|
Reference in New Issue
Block a user