Skip to content

Commit

Permalink
fix:eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nishekh-e-r committed Jun 19, 2023
1 parent 76864c4 commit 250c9f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions server/controllers/stripeController.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ module.exports = {
);
ctx.send(checkoutSessionResponse, 200);
},

async retrieveCheckoutSession(ctx) {
try {
const { id } = ctx.params;
Expand All @@ -108,8 +109,7 @@ module.exports = {
.retrieveCheckoutSession(id);

if (retrieveCheckoutSessionResponse.payment_status === 'paid') {
const { customer_details, amount_total, id, payment_intent, metadata } =
retrieveCheckoutSessionResponse;
const { customer_details, amount_total, id, metadata } = retrieveCheckoutSessionResponse;

const queryId = metadata.productId;
// get id from productschema
Expand All @@ -126,7 +126,7 @@ module.exports = {
const customerEmail = customer_details.email;
const stripeProduct = res.id;

const savePaymentDetails = await strapi.query('plugin::strapi-stripe.ss-payment').create({
await strapi.query('plugin::strapi-stripe.ss-payment').create({
data: {
txnDate,
transactionId,
Expand Down Expand Up @@ -210,7 +210,7 @@ module.exports = {
email
);

ctx.send({ url: checkoutSessionResponse?.url }, 200);
ctx.send({ url: checkoutSessionResponse.url }, 200);
}
} catch (error) {
console.error(error);
Expand Down
4 changes: 2 additions & 2 deletions server/policies/apiToken.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use strict';

module.exports = async (policyContext, config, { strapi }) => {
const bearerToken = policyContext.request.header?.authorization?.substring('Bearer '.length);
const bearerToken = policyContext.request.header.authorization.substring('Bearer '.length);

if (!bearerToken) {
return false;
}
const apiTokenService = strapi.services['admin::api-token'];
const accessKey = await apiTokenService.hash(bearerToken);
const storedToken = await apiTokenService.getBy({ accessKey: accessKey });
const storedToken = await apiTokenService.getBy({ accessKey });

if (!storedToken) {
return false;
Expand Down

0 comments on commit 250c9f8

Please sign in to comment.