mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-20 04:39:20 +00:00
feat: added user association to queues
This commit is contained in:
@@ -18,7 +18,7 @@ interface Response {
|
||||
const CreateWhatsAppService = async ({
|
||||
name,
|
||||
status = "OPENING",
|
||||
queueIds,
|
||||
queueIds = [],
|
||||
isDefault = false
|
||||
}: Request): Promise<Response> => {
|
||||
const schema = Yup.object().shape({
|
||||
@@ -64,14 +64,19 @@ const CreateWhatsAppService = async ({
|
||||
}
|
||||
}
|
||||
|
||||
const whatsapp = await Whatsapp.create({
|
||||
name,
|
||||
status,
|
||||
isDefault
|
||||
});
|
||||
const whatsapp = await Whatsapp.create(
|
||||
{
|
||||
name,
|
||||
status,
|
||||
isDefault
|
||||
},
|
||||
{ include: ["queues"] }
|
||||
);
|
||||
|
||||
await whatsapp.$set("queues", queueIds);
|
||||
|
||||
await whatsapp.reload();
|
||||
|
||||
return { whatsapp, oldDefaultWhatsapp };
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user