mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 12:19:16 +00:00
all routes changed to typescript
This commit is contained in:
@@ -5,10 +5,8 @@ import authRoutes from "./authRoutes";
|
||||
import settingRoutes from "./settingRoutes";
|
||||
import contactRoutes from "./contactRoutes";
|
||||
import ticketRoutes from "./ticketRoutes";
|
||||
|
||||
// const MessagesRoutes = require("./routes/messages");
|
||||
// const WhatsRoutes = require("./routes/whatsapp");
|
||||
// const UsersRoutes = require("./routes/users");
|
||||
import whatsappRoutes from "./whatsappRoutes";
|
||||
import messageRoutes from "./messageRoutes";
|
||||
|
||||
const routes = Router();
|
||||
|
||||
@@ -17,7 +15,7 @@ routes.use("/auth", authRoutes);
|
||||
routes.use(settingRoutes);
|
||||
routes.use(contactRoutes);
|
||||
routes.use(ticketRoutes);
|
||||
// routes.use(MessagesRoutes);
|
||||
// routes.use(WhatsRoutes);
|
||||
routes.use(whatsappRoutes);
|
||||
routes.use(messageRoutes);
|
||||
|
||||
export default routes;
|
||||
|
||||
12
backend/src/routes/messageRoutes.ts
Normal file
12
backend/src/routes/messageRoutes.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Router } from "express";
|
||||
// import isAuth from "../middleware/isAuth";
|
||||
|
||||
// import { index, store } from "../controllers/MessageController";
|
||||
|
||||
const messageRoutes = Router();
|
||||
|
||||
// messageRoutes.get("/messages/:ticketId", isAuth, index);
|
||||
|
||||
// messageRoutes.post("/messages/:ticketId", isAuth, store);
|
||||
|
||||
export default messageRoutes;
|
||||
@@ -1,12 +0,0 @@
|
||||
const express = require("express");
|
||||
const isAuth = require("../../middleware/is-auth");
|
||||
|
||||
const MessageController = require("../../controllers/MessageController");
|
||||
|
||||
const routes = express.Router();
|
||||
|
||||
routes.get("/messages/:ticketId", isAuth, MessageController.index);
|
||||
|
||||
routes.post("/messages/:ticketId", isAuth, MessageController.store);
|
||||
|
||||
module.exports = routes;
|
||||
@@ -1,18 +0,0 @@
|
||||
const express = require("express");
|
||||
const isAuth = require("../../middleware/is-auth");
|
||||
|
||||
const WhatsAppController = require("../../controllers/WhatsAppController");
|
||||
|
||||
const routes = express.Router();
|
||||
|
||||
routes.get("/whatsapp/", isAuth, WhatsAppController.index);
|
||||
|
||||
routes.post("/whatsapp/", isAuth, WhatsAppController.store);
|
||||
|
||||
routes.get("/whatsapp/:whatsappId", isAuth, WhatsAppController.show);
|
||||
|
||||
routes.put("/whatsapp/:whatsappId", isAuth, WhatsAppController.update);
|
||||
|
||||
routes.delete("/whatsapp/:whatsappId", isAuth, WhatsAppController.delete);
|
||||
|
||||
module.exports = routes;
|
||||
22
backend/src/routes/whatsappRoutes.ts
Normal file
22
backend/src/routes/whatsappRoutes.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import express from "express";
|
||||
import isAuth from "../middleware/isAuth";
|
||||
|
||||
import * as WhatsAppController from "../controllers/WhatsAppController";
|
||||
|
||||
const whatsappRoutes = express.Router();
|
||||
|
||||
whatsappRoutes.get("/whatsapp/", isAuth, WhatsAppController.index);
|
||||
|
||||
whatsappRoutes.post("/whatsapp/", isAuth, WhatsAppController.store);
|
||||
|
||||
// whatsappRoutes.get("/whatsapp/:whatsappId", isAuth, WhatsAppController.show);
|
||||
|
||||
// whatsappRoutes.put("/whatsapp/:whatsappId", isAuth, WhatsAppController.update);
|
||||
|
||||
// whatsappRoutes.remove(
|
||||
// "/whatsapp/:whatsappId",
|
||||
// isAuth,
|
||||
// WhatsAppController.delete
|
||||
// );
|
||||
|
||||
export default whatsappRoutes;
|
||||
Reference in New Issue
Block a user