mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 03:39:29 +00:00
change service names
This commit is contained in:
@@ -2,7 +2,7 @@ import { Request, Response } from "express";
|
||||
|
||||
import ListContactsService from "../services/ContactServices/ListContactsService";
|
||||
import CreateContactService from "../services/ContactServices/CreateContactService";
|
||||
import ShowContactService from "../services/ContactServices/ShowContactService";
|
||||
import FindContactService from "../services/ContactServices/FindContactService";
|
||||
import UpdateContactService from "../services/ContactServices/UpdateContactService";
|
||||
import DeleteContactService from "../services/ContactServices/DeleteContactService";
|
||||
|
||||
@@ -94,7 +94,7 @@ export const store = async (req: Request, res: Response): Promise<Response> => {
|
||||
export const show = async (req: Request, res: Response): Promise<Response> => {
|
||||
const { contactId } = req.params;
|
||||
|
||||
const contact = await ShowContactService(contactId);
|
||||
const contact = await FindContactService(contactId);
|
||||
|
||||
return res.status(200).json(contact);
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@ import AppError from "../errors/AppError";
|
||||
import CreateUserService from "../services/UserServices/CreateUserService";
|
||||
import ListUsersService from "../services/UserServices/ListUsersService";
|
||||
import UpdateUserService from "../services/UserServices/UpdateUserService";
|
||||
import ShowUserService from "../services/UserServices/ShowUserService";
|
||||
import FindUserService from "../services/UserServices/FindUserService";
|
||||
import DeleteUserService from "../services/UserServices/DeleteUserService";
|
||||
|
||||
type RequestQuery = {
|
||||
@@ -53,7 +53,7 @@ export const store = async (req: Request, res: Response): Promise<Response> => {
|
||||
export const show = async (req: Request, res: Response): Promise<Response> => {
|
||||
const { userId } = req.params;
|
||||
|
||||
const user = await ShowUserService(userId);
|
||||
const user = await FindUserService(userId);
|
||||
|
||||
return res.status(200).json(user);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Contact from "../../models/Contact";
|
||||
import AppError from "../../errors/AppError";
|
||||
|
||||
const ShowContactService = async (id: string): Promise<Contact> => {
|
||||
const FindContactService = async (id: string): Promise<Contact> => {
|
||||
const user = await Contact.findOne({
|
||||
where: { id },
|
||||
attributes: ["id", "name", "number", "email"]
|
||||
@@ -14,4 +14,4 @@ const ShowContactService = async (id: string): Promise<Contact> => {
|
||||
return user;
|
||||
};
|
||||
|
||||
export default ShowContactService;
|
||||
export default FindContactService;
|
||||
@@ -1,7 +1,7 @@
|
||||
import User from "../../models/User";
|
||||
import AppError from "../../errors/AppError";
|
||||
|
||||
const ShowUserService = async (id: string): Promise<User | undefined> => {
|
||||
const FindUserService = async (id: string): Promise<User | undefined> => {
|
||||
const user = await User.findOne({
|
||||
where: { id },
|
||||
attributes: ["name", "id", "email", "profile"]
|
||||
@@ -14,4 +14,4 @@ const ShowUserService = async (id: string): Promise<User | undefined> => {
|
||||
return user;
|
||||
};
|
||||
|
||||
export default ShowUserService;
|
||||
export default FindUserService;
|
||||
Reference in New Issue
Block a user