export const updateContact = asyncHandler(
async (req: Request, res: Response) => {
const { contactId } = req.params;
const result = await Contact.findByIdAndUpdate(
{ _id: contactId },
req.body
);
if (!result) {
const error = new ApiError(404, "Contact not found.");
throw error;
}
res.status(200).json(result);
}
);