diff --git a/server-script/startappprod.sh b/server-script/startappprod.sh
index e6669a8a..e7f711a5 100755
--- a/server-script/startappprod.sh
+++ b/server-script/startappprod.sh
@@ -2,4 +2,4 @@
cd /var/www/aihomework/prod/
mkdir -p logs
-/usr/bin/yarn prod >> logs/prodoutput.log 2>&1
+/usr/bin/yarn start >> logs/prodoutput.log 2>&1
diff --git a/src/config/index.ts b/src/config/index.ts
index 52668c2c..e2bbc1e2 100644
--- a/src/config/index.ts
+++ b/src/config/index.ts
@@ -1,10 +1,6 @@
import dotenv from "dotenv";
dotenv.config();
-const app = require("express")();
-app.use(require("express").json());
-
-const stripe = require("stripe")(process.env.STRIPE_SECRET_KEY);
const config = {
port: process.env.PORT ?? 8000,
"api-prefix": "api/v1",
diff --git a/src/controllers/PaymentController.ts b/src/controllers/PaymentController.ts
index bb746c58..4c181497 100644
--- a/src/controllers/PaymentController.ts
+++ b/src/controllers/PaymentController.ts
@@ -15,7 +15,6 @@ export class PaymentController {
return res.json(paymentResponse);
} catch (error) {
- console.error("Error initiating payment:", error);
return res.status(500).json({ error: "Payment initiation failed" });
}
}
@@ -35,7 +34,6 @@ export class PaymentController {
return res.json(verificationResponse);
} catch (error) {
- console.error("Error verifying payment:", error);
return res.status(500).json({ error: "Payment verification failed" });
}
}
diff --git a/src/controllers/PaymentLemonSqueezyController.ts b/src/controllers/PaymentLemonSqueezyController.ts
index 935ff9f9..47f530d4 100644
--- a/src/controllers/PaymentLemonSqueezyController.ts
+++ b/src/controllers/PaymentLemonSqueezyController.ts
@@ -11,7 +11,6 @@ import config from "../config";
import { Payment } from "../models/payment";
import AppDataSource from "../data-source";
-
/**
* @swagger
* /api/v1/payments/lemonsqueezy/initiate:
@@ -44,14 +43,12 @@ export const makePaymentLemonSqueezy = async (req: Request, res: Response) => {
`Make Payments`,
);
} catch (error) {
- console.error(error);
res
.status(500)
.json({ error: "An error occurred while processing the payment" });
}
};
-
/**
* @swagger
* /api/v1/payments/lemonsqueezy/webhook:
@@ -128,7 +125,6 @@ export const LemonSqueezyWebhook = async (req: Request, res: Response) => {
await paymentRepository.save(payment);
res.status(200).send("Webhook received");
} catch (error) {
- console.error("Webhook verification failed:", error.message);
res.status(400).send("Webhook verification failed");
}
};
diff --git a/src/data-source.ts b/src/data-source.ts
index c081a0f2..89ea2564 100644
--- a/src/data-source.ts
+++ b/src/data-source.ts
@@ -16,12 +16,12 @@ const AppDataSource = new DataSource({
entities: ["src/models/**/*.ts"],
migrations: ["src/migrations/**/*.ts"],
migrationsTableName: "migrations",
- // ssl: true,
- // extra: {
- // ssl: {
- // rejectUnauthorized: false,
- // },
- // },
+ ssl: true,
+ extra: {
+ ssl: {
+ rejectUnauthorized: false,
+ },
+ },
});
export async function initializeDataSource() {
diff --git a/src/middleware/checkUserRole.ts b/src/middleware/checkUserRole.ts
index 8396a3ed..33f816ce 100644
--- a/src/middleware/checkUserRole.ts
+++ b/src/middleware/checkUserRole.ts
@@ -24,8 +24,7 @@ export const checkPermissions = (roles: UserRole[]) => {
const user = await userRepository.findOne({
where: { id: decodedToken.userId },
});
- // console.log(user);
- // if (user.role !== 'super_admin' )
+
if (!user || !roles.includes(user.role)) {
return res
.status(403)
diff --git a/src/services/org.services.ts b/src/services/org.services.ts
index 97af030b..7696fa67 100644
--- a/src/services/org.services.ts
+++ b/src/services/org.services.ts
@@ -30,7 +30,6 @@ export class OrgService implements IOrgService {
return { newOrganisation };
} catch (error) {
- console.log(error);
throw new BadRequest("Client error");
}
}
diff --git a/src/services/organisation.service.ts b/src/services/organisation.service.ts
index bbc26b27..63ab5415 100644
--- a/src/services/organisation.service.ts
+++ b/src/services/organisation.service.ts
@@ -32,7 +32,6 @@ export class OrgService implements IOrgService {
return { newOrganisation };
} catch (error) {
- console.log(error);
throw new BadRequest("Client error");
}
}
diff --git a/src/services/organization.services.ts b/src/services/organization.services.ts
index a02199e9..b477010b 100644
--- a/src/services/organization.services.ts
+++ b/src/services/organization.services.ts
@@ -32,7 +32,6 @@ export class OrgService implements IOrgService {
return { newOrganisation };
} catch (error) {
- console.log(error);
throw new BadRequest("Client error");
}
}
diff --git a/src/services/payment/flutter.service.ts b/src/services/payment/flutter.service.ts
index 738cf621..bdbc3ec2 100644
--- a/src/services/payment/flutter.service.ts
+++ b/src/services/payment/flutter.service.ts
@@ -55,7 +55,6 @@ export const initializePayment = async (
});
return response;
} catch (error) {
- console.error("Error initializing payment:", error);
throw error;
}
};
@@ -79,7 +78,6 @@ export const verifyPayment = async (transactionId: string): Promise