Skip to content

Commit

Permalink
wildcard imports
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Jun 27, 2024
1 parent 82906b0 commit ef4be90
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 96 deletions.
20 changes: 10 additions & 10 deletions routes/lots.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import handler_doGetLotTypeFields from '../handlers/lots-post/doGetLotTypeFields
import handler_doSearchLots from '../handlers/lots-post/doSearchLots.js';
import handler_doUpdateLot from '../handlers/lots-post/doUpdateLot.js';
import handler_doUpdateLotComment from '../handlers/lots-post/doUpdateLotComment.js';
import * as permissionHandlers from '../handlers/permissions.js';
import { updateGetHandler, updatePostHandler } from '../handlers/permissions.js';
export const router = Router();
/*
* Lot Search
Expand All @@ -23,16 +23,16 @@ router.post('/doSearchLots', handler_doSearchLots);
/*
* Lot View / Edit
*/
router.get('/new', permissionHandlers.updateGetHandler, handler_new);
router.get('/new', updateGetHandler, handler_new);
router.get('/:lotId', handler_view);
router.get('/:lotId/next', handler_next);
router.get('/:lotId/previous', handler_previous);
router.get('/:lotId/edit', permissionHandlers.updateGetHandler, handler_edit);
router.post('/doGetLotTypeFields', permissionHandlers.updatePostHandler, handler_doGetLotTypeFields);
router.post('/doCreateLot', permissionHandlers.updatePostHandler, handler_doCreateLot);
router.post('/doUpdateLot', permissionHandlers.updatePostHandler, handler_doUpdateLot);
router.post('/doDeleteLot', permissionHandlers.updatePostHandler, handler_doDeleteLot);
router.post('/doAddLotComment', permissionHandlers.updatePostHandler, handler_doAddLotComment);
router.post('/doUpdateLotComment', permissionHandlers.updatePostHandler, handler_doUpdateLotComment);
router.post('/doDeleteLotComment', permissionHandlers.updatePostHandler, handler_doDeleteLotComment);
router.get('/:lotId/edit', updateGetHandler, handler_edit);
router.post('/doGetLotTypeFields', updatePostHandler, handler_doGetLotTypeFields);
router.post('/doCreateLot', updatePostHandler, handler_doCreateLot);
router.post('/doUpdateLot', updatePostHandler, handler_doUpdateLot);
router.post('/doDeleteLot', updatePostHandler, handler_doDeleteLot);
router.post('/doAddLotComment', updatePostHandler, handler_doAddLotComment);
router.post('/doUpdateLotComment', updatePostHandler, handler_doUpdateLotComment);
router.post('/doDeleteLotComment', updatePostHandler, handler_doDeleteLotComment);
export default router;
28 changes: 10 additions & 18 deletions routes/lots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import handler_doGetLotTypeFields from '../handlers/lots-post/doGetLotTypeFields
import handler_doSearchLots from '../handlers/lots-post/doSearchLots.js'
import handler_doUpdateLot from '../handlers/lots-post/doUpdateLot.js'
import handler_doUpdateLotComment from '../handlers/lots-post/doUpdateLotComment.js'
import * as permissionHandlers from '../handlers/permissions.js'
import { updateGetHandler, updatePostHandler } from '../handlers/permissions.js'

export const router = Router()

Expand All @@ -30,63 +30,55 @@ router.post('/doSearchLots', handler_doSearchLots as RequestHandler)
* Lot View / Edit
*/

router.get(
'/new',
permissionHandlers.updateGetHandler,
handler_new as RequestHandler
)
router.get('/new', updateGetHandler, handler_new as RequestHandler)

router.get('/:lotId', handler_view as RequestHandler)

router.get('/:lotId/next', handler_next as RequestHandler)

router.get('/:lotId/previous', handler_previous as RequestHandler)

router.get(
'/:lotId/edit',
permissionHandlers.updateGetHandler,
handler_edit as RequestHandler
)
router.get('/:lotId/edit', updateGetHandler, handler_edit as RequestHandler)

router.post(
'/doGetLotTypeFields',
permissionHandlers.updatePostHandler,
updatePostHandler,
handler_doGetLotTypeFields as RequestHandler
)

router.post(
'/doCreateLot',
permissionHandlers.updatePostHandler,
updatePostHandler,
handler_doCreateLot as RequestHandler
)

router.post(
'/doUpdateLot',
permissionHandlers.updatePostHandler,
updatePostHandler,
handler_doUpdateLot as RequestHandler
)

router.post(
'/doDeleteLot',
permissionHandlers.updatePostHandler,
updatePostHandler,
handler_doDeleteLot as RequestHandler
)

router.post(
'/doAddLotComment',
permissionHandlers.updatePostHandler,
updatePostHandler,
handler_doAddLotComment as RequestHandler
)

router.post(
'/doUpdateLotComment',
permissionHandlers.updatePostHandler,
updatePostHandler,
handler_doUpdateLotComment as RequestHandler
)

router.post(
'/doDeleteLotComment',
permissionHandlers.updatePostHandler,
updatePostHandler,
handler_doDeleteLotComment as RequestHandler
)

Expand Down
12 changes: 6 additions & 6 deletions routes/maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import handler_view from '../handlers/maps-get/view.js';
import handler_doCreateMap from '../handlers/maps-post/doCreateMap.js';
import handler_doDeleteMap from '../handlers/maps-post/doDeleteMap.js';
import handler_doUpdateMap from '../handlers/maps-post/doUpdateMap.js';
import * as permissionHandlers from '../handlers/permissions.js';
import { updateGetHandler, updatePostHandler } from '../handlers/permissions.js';
export const router = Router();
router.get('/', handler_search);
router.get('/new', permissionHandlers.updateGetHandler, handler_new);
router.get('/new', updateGetHandler, handler_new);
router.get('/:mapId', handler_view);
router.get('/:mapId/next', handler_next);
router.get('/:mapId/previous', handler_previous);
router.get('/:mapId/edit', permissionHandlers.updateGetHandler, handler_edit);
router.post('/doCreateMap', permissionHandlers.updatePostHandler, handler_doCreateMap);
router.post('/doUpdateMap', permissionHandlers.updatePostHandler, handler_doUpdateMap);
router.post('/doDeleteMap', permissionHandlers.updatePostHandler, handler_doDeleteMap);
router.get('/:mapId/edit', updateGetHandler, handler_edit);
router.post('/doCreateMap', updatePostHandler, handler_doCreateMap);
router.post('/doUpdateMap', updatePostHandler, handler_doUpdateMap);
router.post('/doDeleteMap', updatePostHandler, handler_doDeleteMap);
export default router;
20 changes: 6 additions & 14 deletions routes/maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,37 @@ import handler_view from '../handlers/maps-get/view.js'
import handler_doCreateMap from '../handlers/maps-post/doCreateMap.js'
import handler_doDeleteMap from '../handlers/maps-post/doDeleteMap.js'
import handler_doUpdateMap from '../handlers/maps-post/doUpdateMap.js'
import * as permissionHandlers from '../handlers/permissions.js'
import { updateGetHandler, updatePostHandler } from '../handlers/permissions.js'

export const router = Router()

router.get('/', handler_search as RequestHandler)

router.get(
'/new',
permissionHandlers.updateGetHandler,
handler_new as RequestHandler
)
router.get('/new', updateGetHandler, handler_new as RequestHandler)

router.get('/:mapId', handler_view as RequestHandler)

router.get('/:mapId/next', handler_next as RequestHandler)

router.get('/:mapId/previous', handler_previous as RequestHandler)

router.get(
'/:mapId/edit',
permissionHandlers.updateGetHandler,
handler_edit as RequestHandler
)
router.get('/:mapId/edit', updateGetHandler, handler_edit as RequestHandler)

router.post(
'/doCreateMap',
permissionHandlers.updatePostHandler,
updatePostHandler,
handler_doCreateMap as RequestHandler
)

router.post(
'/doUpdateMap',
permissionHandlers.updatePostHandler,
updatePostHandler,
handler_doUpdateMap as RequestHandler
)

router.post(
'/doDeleteMap',
permissionHandlers.updatePostHandler,
updatePostHandler,
handler_doDeleteMap as RequestHandler
)

Expand Down
42 changes: 21 additions & 21 deletions routes/workOrders.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Router } from 'express';
import * as permissionHandlers from '../handlers/permissions.js';
import { updateGetHandler, updatePostHandler } from '../handlers/permissions.js';
import handler_edit from '../handlers/workOrders-get/edit.js';
import handler_milestoneCalendar from '../handlers/workOrders-get/milestoneCalendar.js';
import handler_new from '../handlers/workOrders-get/new.js';
Expand Down Expand Up @@ -36,30 +36,30 @@ router.post('/doGetWorkOrderMilestones', handler_doGetWorkOrderMilestones);
// Outlook Integration
router.get('/outlook', handler_outlook);
// New
router.get('/new', permissionHandlers.updateGetHandler, handler_new);
router.post('/doCreateWorkOrder', permissionHandlers.updatePostHandler, handler_doCreateWorkOrder);
router.get('/new', updateGetHandler, handler_new);
router.post('/doCreateWorkOrder', updatePostHandler, handler_doCreateWorkOrder);
// View
router.get('/:workOrderId', handler_view);
router.post('/doReopenWorkOrder', permissionHandlers.updatePostHandler, handler_doReopenWorkOrder);
router.post('/doReopenWorkOrder', updatePostHandler, handler_doReopenWorkOrder);
// Edit
router.get('/:workOrderId/edit', permissionHandlers.updateGetHandler, handler_edit);
router.post('/doUpdateWorkOrder', permissionHandlers.updatePostHandler, handler_doUpdateWorkOrder);
router.post('/doCloseWorkOrder', permissionHandlers.updatePostHandler, handler_doCloseWorkOrder);
router.post('/doDeleteWorkOrder', permissionHandlers.updatePostHandler, handler_doDeleteWorkOrder);
router.get('/:workOrderId/edit', updateGetHandler, handler_edit);
router.post('/doUpdateWorkOrder', updatePostHandler, handler_doUpdateWorkOrder);
router.post('/doCloseWorkOrder', updatePostHandler, handler_doCloseWorkOrder);
router.post('/doDeleteWorkOrder', updatePostHandler, handler_doDeleteWorkOrder);
// Lot Occupancy
router.post('/doAddWorkOrderLotOccupancy', permissionHandlers.updatePostHandler, handler_doAddWorkOrderLotOccupancy);
router.post('/doDeleteWorkOrderLotOccupancy', permissionHandlers.updatePostHandler, handler_doDeleteWorkOrderLotOccupancy);
router.post('/doAddWorkOrderLot', permissionHandlers.updatePostHandler, handler_doAddWorkOrderLot);
router.post('/doUpdateLotStatus', permissionHandlers.updatePostHandler, handler_doUpdateLotStatus);
router.post('/doDeleteWorkOrderLot', permissionHandlers.updatePostHandler, handler_doDeleteWorkOrderLot);
router.post('/doAddWorkOrderLotOccupancy', updatePostHandler, handler_doAddWorkOrderLotOccupancy);
router.post('/doDeleteWorkOrderLotOccupancy', updatePostHandler, handler_doDeleteWorkOrderLotOccupancy);
router.post('/doAddWorkOrderLot', updatePostHandler, handler_doAddWorkOrderLot);
router.post('/doUpdateLotStatus', updatePostHandler, handler_doUpdateLotStatus);
router.post('/doDeleteWorkOrderLot', updatePostHandler, handler_doDeleteWorkOrderLot);
// Comments
router.post('/doAddWorkOrderComment', permissionHandlers.updatePostHandler, handler_doAddWorkOrderComment);
router.post('/doUpdateWorkOrderComment', permissionHandlers.updatePostHandler, handler_doUpdateWorkOrderComment);
router.post('/doDeleteWorkOrderComment', permissionHandlers.updatePostHandler, handler_doDeleteWorkOrderComment);
router.post('/doAddWorkOrderComment', updatePostHandler, handler_doAddWorkOrderComment);
router.post('/doUpdateWorkOrderComment', updatePostHandler, handler_doUpdateWorkOrderComment);
router.post('/doDeleteWorkOrderComment', updatePostHandler, handler_doDeleteWorkOrderComment);
// Milestones
router.post('/doAddWorkOrderMilestone', permissionHandlers.updatePostHandler, handler_doAddWorkOrderMilestone);
router.post('/doUpdateWorkOrderMilestone', permissionHandlers.updatePostHandler, handler_doUpdateWorkOrderMilestone);
router.post('/doCompleteWorkOrderMilestone', permissionHandlers.updatePostHandler, handler_doCompleteWorkOrderMilestone);
router.post('/doReopenWorkOrderMilestone', permissionHandlers.updatePostHandler, handler_doReopenWorkOrderMilestone);
router.post('/doDeleteWorkOrderMilestone', permissionHandlers.updatePostHandler, handler_doDeleteWorkOrderMilestone);
router.post('/doAddWorkOrderMilestone', updatePostHandler, handler_doAddWorkOrderMilestone);
router.post('/doUpdateWorkOrderMilestone', updatePostHandler, handler_doUpdateWorkOrderMilestone);
router.post('/doCompleteWorkOrderMilestone', updatePostHandler, handler_doCompleteWorkOrderMilestone);
router.post('/doReopenWorkOrderMilestone', updatePostHandler, handler_doReopenWorkOrderMilestone);
router.post('/doDeleteWorkOrderMilestone', updatePostHandler, handler_doDeleteWorkOrderMilestone);
export default router;
Loading

0 comments on commit ef4be90

Please sign in to comment.