refactor: rewrite useInvoices with RQ

This commit is contained in:
Rıdvan Akca
2024-03-13 13:59:56 +03:00
parent c849afbc11
commit 87c25cbbfe
6 changed files with 24 additions and 52 deletions

View File

@@ -1,19 +0,0 @@
import Billing from '../../helpers/billing/index.ee.js';
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;

View File

@@ -9,7 +9,6 @@ import getDynamicData from './queries/get-dynamic-data.js';
import getDynamicFields from './queries/get-dynamic-fields.js';
import getFlow from './queries/get-flow.js';
import getFlows from './queries/get-flows.js';
import getInvoices from './queries/get-invoices.ee.js';
import getNotifications from './queries/get-notifications.js';
import getPermissionCatalog from './queries/get-permission-catalog.ee.js';
import getRole from './queries/get-role.ee.js';
@@ -37,7 +36,6 @@ const queryResolvers = {
getDynamicFields,
getFlow,
getFlows,
getInvoices,
getNotifications,
getPermissionCatalog,
getRole,

View File

@@ -26,7 +26,6 @@ type Query {
getBillingAndUsage: GetBillingAndUsage
getCurrentUser: User
getConfig(keys: [String]): JSONObject
getInvoices: [Invoice]
getPermissionCatalog: PermissionCatalog
getRole(id: String!): Role
getRoles: [Role]
@@ -658,14 +657,6 @@ type Usage {
task: Int
}
type Invoice {
id: Int
amount: Float
currency: String
payout_date: String
receipt_url: String
}
type ListSamlAuthProvider {
id: String
name: String