mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-21 13:19:21 +00:00
changed find to show services
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 FindContactService from "../services/ContactServices/FindContactService";
|
||||
import ShowContactService from "../services/ContactServices/ShowContactService";
|
||||
import UpdateContactService from "../services/ContactServices/UpdateContactService";
|
||||
import DeleteContactService from "../services/ContactServices/DeleteContactService";
|
||||
|
||||
@@ -97,7 +97,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 FindContactService(contactId);
|
||||
const contact = await ShowContactService(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 FindUserService from "../services/UserServices/FindUserService";
|
||||
import ShowUserService from "../services/UserServices/ShowUserService";
|
||||
import DeleteUserService from "../services/UserServices/DeleteUserService";
|
||||
|
||||
type IndexQuery = {
|
||||
@@ -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 FindUserService(userId);
|
||||
const user = await ShowUserService(userId);
|
||||
|
||||
return res.status(200).json(user);
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Request, Response } from "express";
|
||||
import CreateWhatsAppService from "../services/WhatsappService/CreateWhatsAppService";
|
||||
import DeleteWhatsAppService from "../services/WhatsappService/DeleteWhatsAppService";
|
||||
import ListWhatsAppsService from "../services/WhatsappService/ListWhatsAppsService";
|
||||
import FindWhatsAppService from "../services/WhatsappService/FindWhatsAppService";
|
||||
import ShowWhatsAppService from "../services/WhatsappService/ShowWhatsAppService";
|
||||
import UpdateWhatsAppService from "../services/WhatsappService/UpdateWhatsAppService";
|
||||
// import Yup from "yup";
|
||||
// import Whatsapp from "../models/Whatsapp";
|
||||
@@ -53,9 +53,7 @@ export const store = async (req: Request, res: Response): Promise<Response> => {
|
||||
export const show = async (req: Request, res: Response): Promise<Response> => {
|
||||
const { whatsappId } = req.params;
|
||||
|
||||
console.log(whatsappId);
|
||||
|
||||
const whatsapp = await FindWhatsAppService(whatsappId);
|
||||
const whatsapp = await ShowWhatsAppService(whatsappId);
|
||||
|
||||
return res.status(200).json(whatsapp);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user