change 'default' to 'isDefault' whatsapp field on frontend

This commit is contained in:
canove
2020-09-20 11:12:32 -03:00
parent aa6f116514
commit 0f0d9470c5
5 changed files with 39 additions and 55 deletions

View File

@@ -12,18 +12,18 @@ import UpdateWhatsAppService from "../services/WhatsappService/UpdateWhatsAppSer
// import wbotMessageListener from "../services/wbotMessageListener";
// import wbotMonitor from "../services/wbotMonitor";
export const index = async (req: Request, res: Response): Promise<Response> => {
const whatsapps = await ListWhatsAppsService();
return res.status(200).json(whatsapps);
};
interface WhatsappData {
name: string;
status?: string;
isDefault?: boolean;
}
export const index = async (req: Request, res: Response): Promise<Response> => {
const whatsapps = await ListWhatsAppsService();
return res.status(200).json(whatsapps);
};
export const store = async (req: Request, res: Response): Promise<Response> => {
// const io = getIO();
@@ -53,7 +53,9 @@ export const store = async (req: Request, res: Response): Promise<Response> => {
export const show = async (req: Request, res: Response): Promise<Response> => {
const { whatsappId } = req.params;
const whatsapp = await FindWhatsAppService({ where: { id: +whatsappId } });
console.log(whatsappId);
const whatsapp = await FindWhatsAppService(whatsappId);
return res.status(200).json(whatsapp);
};