added date at support ticket, new order support tickets, delete edit support ticktes only from enploye and admins

This commit is contained in:
2026-02-08 18:26:34 +01:00
parent 4f588015a4
commit 746706ef01
8 changed files with 888 additions and 752 deletions
+4 -16
View File
@@ -42,16 +42,10 @@ async function getTasksByContract(filters) {
where,
include: {
subtasks: {
orderBy: [
{ status: 'asc' },
{ createdAt: 'asc' },
],
orderBy: { createdAt: 'asc' },
},
},
orderBy: [
{ status: 'asc' }, // OPEN first, then COMPLETED
{ createdAt: 'desc' },
],
orderBy: { createdAt: 'desc' },
});
}
async function getTaskById(id) {
@@ -210,10 +204,7 @@ async function getAllTasks(filters) {
where,
include: {
subtasks: {
orderBy: [
{ status: 'asc' },
{ createdAt: 'asc' },
],
orderBy: { createdAt: 'asc' },
},
contract: {
select: {
@@ -246,10 +237,7 @@ async function getAllTasks(filters) {
},
},
},
orderBy: [
{ status: 'asc' }, // OPEN first, then COMPLETED
{ createdAt: 'desc' },
],
orderBy: { createdAt: 'desc' },
});
}
async function getTaskStats(filters) {