Files
quicklanch-server/dist/app/modules/order/order.controller.js
T
abumahid 0f7af70b90 ♻️ refactor(account, order, plan, profile, support, email): restructure application modules and enhance error handling
Updated Docker configuration, refactored middleware for improved error handling, and restructured account, order, plan, profile, and support modules, including their routes, services, and validations. Enhanced email processing queues and utilities for token generation, pagination, and response management to streamline the application architecture and enhance maintainability.
2026-04-21 03:12:39 +06:00

61 lines
1.7 KiB
JavaScript

import catchAsync from "../../utils/catch_async.js";
import manageResponse from "../../utils/manage_response.js";
import { order_service } from "./order.service.js";
const get_all_order = catchAsync(async (req, res) => {
const result = await order_service.get_all_order_from_db(req);
manageResponse(res, {
success: true,
statusCode: 200,
message: "All order fetched successfully.",
data: result,
meta: {},
});
});
const get_single_order = catchAsync(async (req, res) => {
const result = await order_service.get_single_order_from_db(req);
manageResponse(res, {
success: true,
statusCode: 200,
message: "Single order fetched successfully.",
data: result,
meta: {},
});
});
const create_order = catchAsync(async (req, res) => {
const result = await order_service.create_order_into_db(req);
manageResponse(res, {
success: true,
statusCode: 200,
message: "order created successfully.",
data: result,
meta: {},
});
});
const update_order = catchAsync(async (req, res) => {
const result = await order_service.update_order_into_db(req);
manageResponse(res, {
success: true,
statusCode: 200,
message: "order updated successfully.",
data: result,
meta: {},
});
});
const delete_order = catchAsync(async (req, res) => {
const result = await order_service.delete_order_from_db(req);
manageResponse(res, {
success: true,
statusCode: 200,
message: "order deleted successfully.",
data: result,
meta: {},
});
});
export const order_controller = {
get_all_order,
get_single_order,
create_order,
update_order,
delete_order,
};