const { formatISOWithoutTimezone } = require("../../../utils/FormatDate");

const formatItem = (item) => ({
    ...item,
    createdAt: formatISOWithoutTimezone(item.createdAt),
    updatedAt: formatISOWithoutTimezone(item.updatedAt)
});

exports.HospitalResource = (res, data, message = 'Success') => {
    const formattedData = formatItem(data);

    return res.status(200).json({
        success: true,
        message,
        data: formattedData
    });
};