main
alex 2024-02-18 10:26:30 +01:00
parent c1804a3663
commit a662087197
4 changed files with 5 additions and 38 deletions

View File

@ -190,7 +190,7 @@ export async function CheckoutCanceled(req: Request, res: Response) {
});
if (userPendingPayment === null) {
console.log("CheckoutCanceled not found");
logger.error("CheckoutCanceled: user pending payment not found");
return res.status(400).send({ err: "invalid request" });
}

View File

@ -114,8 +114,6 @@ export async function AddEmployee(req: Request, res: Response) {
if (email !== undefined && email.length > 0) {
email = email.toLowerCase();
console.log("email", email);
if (!(await isEmailValid(email))) {
return res.status(400).send({ err: "invalid request" });
}

View File

@ -26,35 +26,3 @@ sequelize
});
export default sequelize;
/*
export let sequelize: Sequelize;
export function initDatabase() {
sequelize = new Sequelize(
process.env.MARIADB_DATABASE as string,
process.env.MARIADB_USER as string,
process.env.MARIADB_PASSWORD as string,
{
host: process.env.MARIADB_HOST as string,
port: Number(process.env.MARIADB_PORT),
dialect: "mariadb",
}
);
sequelize
.authenticate()
.then(() => {
logger.info("Connection has been established successfully.");
})
.catch((err: Error) => {
console.error("Unable to connect to the database:", err);
});
}
export function syncDatabase() {
sequelize.sync({ force: true }).then(() => {
console.log(`Database & tables created!`);
});
}
*/

View File

@ -1,4 +1,5 @@
import amqplib from "amqplib";
import logger from "../logger/logger";
let channel: amqplib.Channel;
@ -13,14 +14,14 @@ async function connect(
);
if (!open) {
console.log("⚡️[RabbitMQ]: connection failed");
logger.error("⚡️[RabbitMQ]: connection failed");
return;
}
channel = await open.createChannel();
if (!channel) {
console.log("⚡️[RabbitMQ]: channel failed");
logger.error("⚡️[RabbitMQ]: channel not available");
return;
}
}
@ -32,7 +33,7 @@ async function sendEmail(
bodyData: any
) {
if (!channel) {
console.log("⚡️[RabbitMQ]: channel not available");
logger.error("⚡️[RabbitMQ]: channel not available");
return;
}