All models using classes and sequelize migrations

This commit is contained in:
canove
2020-07-17 14:29:10 -03:00
parent a41f7e63ac
commit 9687a1ce13
22 changed files with 578 additions and 191 deletions

View File

@@ -5,8 +5,8 @@ const MessageController = require("../controllers/MessageController");
const routes = express.Router();
routes.get("/messages/:contactId", isAuth, MessageController.index);
routes.get("/messages/:ticketId", isAuth, MessageController.index);
routes.post("/messages/:contactId", isAuth, MessageController.store);
routes.post("/messages/:ticketId", isAuth, MessageController.store);
module.exports = routes;

View File

@@ -0,0 +1,14 @@
const express = require("express");
const isAuth = require("../middleware/is-auth");
const TicketController = require("../controllers/TicketController");
const routes = express.Router();
routes.get("/tickets", isAuth, TicketController.index);
routes.post("/tickets", isAuth, TicketController.store);
routes.put("/tickets/:ticketId", isAuth, TicketController.update);
module.exports = routes;

View File

@@ -1,12 +1,17 @@
const express = require("express");
const isAuth = require("../middleware/is-auth");
const WhatsappController = require("../controllers/whatsapp");
const WhatsAppSessionController = require("../controllers/WhatsAppSessionController");
const routes = express.Router();
routes.get("/whatsapp/session", isAuth, WhatsappController.getSession);
routes.get(
"/whatsapp/session/:sessionId",
isAuth,
WhatsAppSessionController.show
);
routes.get("/whatsapp/contacts", isAuth, WhatsappController.getContacts); // fetch contacts in user cellphone, not in use
// fetch contacts in user cellphone, not in use
// routes.get("/whatsapp/contacts", isAuth, WhatsappController.getContacts);
module.exports = routes;