Spaces:
Runtime error
Runtime error
Commit ·
86a5fc6
1
Parent(s): 6d0da36
add created at in sort columns
Browse files
src/controllers/auditLog.controller.ts
CHANGED
|
@@ -28,7 +28,7 @@ const getAuditLogs = async (req: Request, res: Response) => {
|
|
| 28 |
const { sort_by, sort_order, page, limit } = req.query;
|
| 29 |
const filter = req.query.filter as Record<string, any>;
|
| 30 |
|
| 31 |
-
const allowedSortColumns = ['id','action_by', 'invoice_id']
|
| 32 |
|
| 33 |
const whereClause = buildAuditLogWhereClause(filter);
|
| 34 |
|
|
|
|
| 28 |
const { sort_by, sort_order, page, limit } = req.query;
|
| 29 |
const filter = req.query.filter as Record<string, any>;
|
| 30 |
|
| 31 |
+
const allowedSortColumns = ['id','action_by', 'invoice_id', 'created_at']
|
| 32 |
|
| 33 |
const whereClause = buildAuditLogWhereClause(filter);
|
| 34 |
|
src/controllers/errorLog.controller.ts
CHANGED
|
@@ -55,7 +55,7 @@ const getErrorLogs = async (req: Request, res: Response) => {
|
|
| 55 |
const { sort_by, sort_order, page, limit } = req.query;
|
| 56 |
const filter = req.query.filter as Record<string, any>;
|
| 57 |
|
| 58 |
-
const allowedSortColumns = ['id', 'invoice_id'];
|
| 59 |
|
| 60 |
const whereClause = buildErrorLogWhereClause(filter);
|
| 61 |
|
|
|
|
| 55 |
const { sort_by, sort_order, page, limit } = req.query;
|
| 56 |
const filter = req.query.filter as Record<string, any>;
|
| 57 |
|
| 58 |
+
const allowedSortColumns = ['id', 'invoice_id', 'created_at'];
|
| 59 |
|
| 60 |
const whereClause = buildErrorLogWhereClause(filter);
|
| 61 |
|
src/controllers/invoice/invoice.controller.ts
CHANGED
|
@@ -157,6 +157,7 @@ export const getAllInvoices = async (req: Request, res: Response): Promise<Respo
|
|
| 157 |
'pw_work_order_id',
|
| 158 |
'pw_vendor_id',
|
| 159 |
'uploaded_by',
|
|
|
|
| 160 |
];
|
| 161 |
|
| 162 |
const whereClause = buildInvoiceWhereClause(filter);
|
|
|
|
| 157 |
'pw_work_order_id',
|
| 158 |
'pw_vendor_id',
|
| 159 |
'uploaded_by',
|
| 160 |
+
'created_at'
|
| 161 |
];
|
| 162 |
|
| 163 |
const whereClause = buildInvoiceWhereClause(filter);
|
src/controllers/user.controller.ts
CHANGED
|
@@ -112,7 +112,7 @@ const getAllUsers = async (req: Request, res: Response) => {
|
|
| 112 |
const { sort_by, sort_order, page, limit } = req.query;
|
| 113 |
const filter = req.query.filter as Record<string, any>;
|
| 114 |
|
| 115 |
-
const allowedSortColumns = ['id', 'name', 'email', 'role_id',];
|
| 116 |
|
| 117 |
const whereClause = buildUserWhereClause(filter);
|
| 118 |
|
|
|
|
| 112 |
const { sort_by, sort_order, page, limit } = req.query;
|
| 113 |
const filter = req.query.filter as Record<string, any>;
|
| 114 |
|
| 115 |
+
const allowedSortColumns = ['id', 'name', 'email', 'role_id', 'created_at'];
|
| 116 |
|
| 117 |
const whereClause = buildUserWhereClause(filter);
|
| 118 |
|