mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 20:29:17 +00:00
changed whatsapp model
This commit is contained in:
@@ -18,6 +18,7 @@ export const index = async (req: Request, res: Response): Promise<Response> => {
|
||||
interface WhatsappData {
|
||||
name: string;
|
||||
status: string;
|
||||
isDefault?: boolean;
|
||||
}
|
||||
|
||||
export const store = async (req: Request, res: Response): Promise<Response> => {
|
||||
@@ -25,9 +26,9 @@ export const store = async (req: Request, res: Response): Promise<Response> => {
|
||||
|
||||
console.log("aqui");
|
||||
|
||||
const { name, status }: WhatsappData = req.body;
|
||||
const { name, status, isDefault }: WhatsappData = req.body;
|
||||
|
||||
const whatsapp = await CreateWhatsAppService({ name, status });
|
||||
const whatsapp = await CreateWhatsAppService({ name, status, isDefault });
|
||||
|
||||
// if (!whatsapp) {
|
||||
// return res.status(400).json({ error: "Cannot create whatsapp session." });
|
||||
|
||||
Reference in New Issue
Block a user