mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-21 13:19:21 +00:00
feat: add queue and assoc with whatsapps
This commit is contained in:
19
backend/src/controllers/QueueController.ts
Normal file
19
backend/src/controllers/QueueController.ts
Normal 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);
|
||||
};
|
||||
Reference in New Issue
Block a user