changed find to show services

This commit is contained in:
canove
2020-09-20 11:27:58 -03:00
parent 4fda0b18c6
commit 02d90af657
13 changed files with 40 additions and 59 deletions

View File

@@ -0,0 +1,14 @@
import Contact from "../../models/Contact";
import AppError from "../../errors/AppError";
const ShowContactService = async (id: string | number): Promise<Contact> => {
const user = await Contact.findByPk(id);
if (!user) {
throw new AppError("No contact found with this ID.", 404);
}
return user;
};
export default ShowContactService;