UNPKG

@dbbs/strapi-stripe-payment

Version:
26 lines (25 loc) 866 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const strapi_1 = require("@strapi/strapi"); exports.default = strapi_1.factories.createCoreService('plugin::stripe-payment.transaction', ({ strapi }) => ({ async getAllTransactions(params) { const { userId } = params; const organization = await strapi.query('plugin::stripe-payment.organization').findOne({ where: { owner_id: userId }, populate: { transactions: true } }); if (!organization) { return null; } const paymentTransactions = await strapi.query('plugin::stripe-payment.transaction').findMany({ where: { organization: organization.id } }); return paymentTransactions; } }));