mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 20:29:17 +00:00
feat: add queue and assoc with whatsapps
This commit is contained in:
@@ -5,6 +5,7 @@ import Whatsapp from "../../models/Whatsapp";
|
||||
|
||||
interface Request {
|
||||
name: string;
|
||||
queueIds: number[];
|
||||
status?: string;
|
||||
isDefault?: boolean;
|
||||
}
|
||||
@@ -17,6 +18,7 @@ interface Response {
|
||||
const CreateWhatsAppService = async ({
|
||||
name,
|
||||
status = "OPENING",
|
||||
queueIds,
|
||||
isDefault = false
|
||||
}: Request): Promise<Response> => {
|
||||
const schema = Yup.object().shape({
|
||||
@@ -68,6 +70,8 @@ const CreateWhatsAppService = async ({
|
||||
isDefault
|
||||
});
|
||||
|
||||
await whatsapp.$set("queues", queueIds);
|
||||
|
||||
return { whatsapp, oldDefaultWhatsapp };
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user