feat: add queue and assoc with whatsapps

This commit is contained in:
canove
2021-01-08 17:41:08 -03:00
parent a12c9db731
commit 9f99245dc4
14 changed files with 217 additions and 7 deletions

View File

@@ -0,0 +1,19 @@
import { Request, Response } from "express";
import Queue from "../models/Queue";
// import { getIO } from "../libs/socket";
// import AppError from "../errors/AppError";
export const index = async (req: Request, res: Response): Promise<Response> => {
const queues = await Queue.findAll();
return res.status(200).json(queues);
};
export const store = async (req: Request, res: Response): Promise<Response> => {
const { name, color } = req.body;
const queue = await Queue.create({ name, color });
return res.status(200).json(queue);
};