Criação do recurso de restrição para o admin não editar a fila nem a conexão
parent
9bb316a0cf
commit
3d69fa84ef
|
@ -1,5 +1,6 @@
|
|||
import { Op, fn, where, col, Filterable, Includeable } from "sequelize";
|
||||
import { startOfDay, endOfDay, parseISO } from "date-fns";
|
||||
import { startOfDay, endOfDay, parseISO, format } from "date-fns";
|
||||
import ptBR from 'date-fns/locale/pt-BR';
|
||||
|
||||
import Ticket from "../../models/Ticket";
|
||||
import Contact from "../../models/Contact";
|
||||
|
@ -7,6 +8,10 @@ import Message from "../../models/Message";
|
|||
import Queue from "../../models/Queue";
|
||||
import ShowUserService from "../UserServices/ShowUserService";
|
||||
|
||||
import { splitDateTime } from "../../helpers/SplitDateTime";
|
||||
const dateToday = splitDateTime(new Date(format(new Date(), 'yyyy-MM-dd HH:mm:ss', { locale: ptBR })))
|
||||
|
||||
|
||||
interface Request {
|
||||
searchParam?: string;
|
||||
pageNumber?: string;
|
||||
|
@ -64,6 +69,17 @@ const ListTicketsService = async ({
|
|||
...whereCondition,
|
||||
status
|
||||
};
|
||||
|
||||
if (unlimited) {
|
||||
whereCondition = {
|
||||
...whereCondition,
|
||||
createdAt: {
|
||||
[Op.gte]: dateToday.fullDate + ' 00:00:00.000000',
|
||||
[Op.lte]: dateToday.fullDate + ' 23:59:59.999999'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (searchParam) {
|
||||
|
|
|
@ -5,7 +5,7 @@ const rules = {
|
|||
|
||||
admin: {
|
||||
static: [
|
||||
"show-icon-edit-whatsapp",
|
||||
//"show-icon-edit-whatsapp",
|
||||
|
||||
"drawer-admin-items:view",
|
||||
"tickets-manager:showall",
|
||||
|
|
Loading…
Reference in New Issue