import Customer from "../models/Customer.js";

export const createCustomer = async (req,res) => {
    try{
const customer = await Customer.create(req.body)
res.status(201).json(customer);
    }catch(error){
res.status(500).json({message:error.message});
    }
};

export const getAllCustomer = async (req,res) => {
    try{
const customer = await Customer.find()
res.status(200).json(customer);
    }catch(error){
res.status(500).json({message:error.message});
    }
};

export const getCustomer = async (req,res) => {
    try{
const customer = await Customer.findById(req.params.id);
res.status(200).json(customer);
    }catch(error){
res.status(500).json({message:error.message});
    }
};

