UNPKG

@dbbs/strapi-stripe-payment

Version:
23 lines (22 loc) 895 B
"use strict"; /** * controller */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const http_errors_1 = __importDefault(require("http-errors")); const strapi_1 = require("@strapi/strapi"); exports.default = strapi_1.factories.createCoreController('plugin::stripe-payment.transaction', ({ strapi }) => ({ async getAllTransactions(ctx) { const { user } = ctx.state; const paymentTransactions = await strapi.plugin('stripe-payment').service('transaction').getAllTransactions({ userId: user.id }); if (!paymentTransactions) { throw new http_errors_1.default.NotFound(`Organization with ownerId ${user.id} was not found`); } ctx.send(paymentTransactions); } }));