"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sendError = exports.sendSuccess = void 0;
const sendSuccess = (res, status, data, message) => {
    const payload = { success: true, data };
    if (message)
        payload.message = message;
    return res.status(status).json(payload);
};
exports.sendSuccess = sendSuccess;
const sendError = (res, status, code, message, details) => {
    const payload = {
        success: false,
        error: {
            code,
            message,
            ...(details === undefined ? {} : { details }),
        },
    };
    return res.status(status).json(payload);
};
exports.sendError = sendError;
//# sourceMappingURL=apiResponse.js.map