more linting
parent
062892ac3f
commit
3b15e5e306
|
|
@ -34,6 +34,7 @@
|
|||
],
|
||||
"@typescript-eslint/no-extra-semi": "off",
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
"@typescript-eslint/no-misused-promises": "warn",
|
||||
"@typescript-eslint/restrict-plus-operands": "warn",
|
||||
"@typescript-eslint/space-before-function-paren": "off",
|
||||
"@typescript-eslint/strict-boolean-expressions": "warn",
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
import * as configFunctions from "../../helpers/functions.config.js";
|
||||
import { getMap } from "../../helpers/lotOccupancyDB/getMap.js";
|
||||
import { getMapSVGs } from "../../helpers/functions.map.js";
|
||||
import { getLotTypeSummary } from "../../helpers/lotOccupancyDB/getLotTypeSummary.js";
|
||||
import { getLotStatusSummary } from "../../helpers/lotOccupancyDB/getLotStatusSummary.js";
|
||||
import * as configFunctions from '../../helpers/functions.config.js';
|
||||
import { getMap } from '../../helpers/lotOccupancyDB/getMap.js';
|
||||
import { getMapSVGs } from '../../helpers/functions.map.js';
|
||||
import { getLotTypeSummary } from '../../helpers/lotOccupancyDB/getLotTypeSummary.js';
|
||||
import { getLotStatusSummary } from '../../helpers/lotOccupancyDB/getLotStatusSummary.js';
|
||||
export const handler = async (request, response) => {
|
||||
const map = getMap(request.params.mapId);
|
||||
if (!map) {
|
||||
return response.redirect(configFunctions.getProperty("reverseProxy.urlPrefix") + "/maps/?error=mapIdNotFound");
|
||||
response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') +
|
||||
'/maps/?error=mapIdNotFound');
|
||||
return;
|
||||
}
|
||||
const mapSVGs = await getMapSVGs();
|
||||
const lotTypeSummary = getLotTypeSummary({
|
||||
|
|
@ -15,7 +17,7 @@ export const handler = async (request, response) => {
|
|||
const lotStatusSummary = getLotStatusSummary({
|
||||
mapId: map.mapId
|
||||
});
|
||||
response.render("map-edit", {
|
||||
response.render('map-edit', {
|
||||
headTitle: map.mapName,
|
||||
isCreate: false,
|
||||
map,
|
||||
|
|
|
|||
|
|
@ -1,40 +1,42 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import * as configFunctions from "../../helpers/functions.config.js";
|
||||
import * as configFunctions from '../../helpers/functions.config.js'
|
||||
|
||||
import { getMap } from "../../helpers/lotOccupancyDB/getMap.js";
|
||||
import { getMap } from '../../helpers/lotOccupancyDB/getMap.js'
|
||||
|
||||
import { getMapSVGs } from "../../helpers/functions.map.js";
|
||||
import { getLotTypeSummary } from "../../helpers/lotOccupancyDB/getLotTypeSummary.js";
|
||||
import { getLotStatusSummary } from "../../helpers/lotOccupancyDB/getLotStatusSummary.js";
|
||||
import { getMapSVGs } from '../../helpers/functions.map.js'
|
||||
import { getLotTypeSummary } from '../../helpers/lotOccupancyDB/getLotTypeSummary.js'
|
||||
import { getLotStatusSummary } from '../../helpers/lotOccupancyDB/getLotStatusSummary.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const map = getMap(request.params.mapId);
|
||||
const map = getMap(request.params.mapId)
|
||||
|
||||
if (!map) {
|
||||
return response.redirect(
|
||||
configFunctions.getProperty("reverseProxy.urlPrefix") + "/maps/?error=mapIdNotFound"
|
||||
);
|
||||
}
|
||||
if (!map) {
|
||||
response.redirect(
|
||||
configFunctions.getProperty('reverseProxy.urlPrefix') +
|
||||
'/maps/?error=mapIdNotFound'
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
const mapSVGs = await getMapSVGs();
|
||||
const mapSVGs = await getMapSVGs()
|
||||
|
||||
const lotTypeSummary = getLotTypeSummary({
|
||||
mapId: map.mapId
|
||||
});
|
||||
const lotTypeSummary = getLotTypeSummary({
|
||||
mapId: map.mapId
|
||||
})
|
||||
|
||||
const lotStatusSummary = getLotStatusSummary({
|
||||
mapId: map.mapId
|
||||
});
|
||||
const lotStatusSummary = getLotStatusSummary({
|
||||
mapId: map.mapId
|
||||
})
|
||||
|
||||
response.render("map-edit", {
|
||||
headTitle: map.mapName,
|
||||
isCreate: false,
|
||||
map,
|
||||
mapSVGs,
|
||||
lotTypeSummary,
|
||||
lotStatusSummary
|
||||
});
|
||||
};
|
||||
response.render('map-edit', {
|
||||
headTitle: map.mapName,
|
||||
isCreate: false,
|
||||
map,
|
||||
mapSVGs,
|
||||
lotTypeSummary,
|
||||
lotStatusSummary
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import * as configFunctions from "../../helpers/functions.config.js";
|
||||
import { getMapSVGs } from "../../helpers/functions.map.js";
|
||||
import * as configFunctions from '../../helpers/functions.config.js';
|
||||
import { getMapSVGs } from '../../helpers/functions.map.js';
|
||||
export const handler = async (_request, response) => {
|
||||
const map = {
|
||||
mapCity: configFunctions.getProperty("settings.map.mapCityDefault"),
|
||||
mapProvince: configFunctions.getProperty("settings.map.mapProvinceDefault")
|
||||
mapCity: configFunctions.getProperty('settings.map.mapCityDefault'),
|
||||
mapProvince: configFunctions.getProperty('settings.map.mapProvinceDefault')
|
||||
};
|
||||
const mapSVGs = await getMapSVGs();
|
||||
response.render("map-edit", {
|
||||
headTitle: configFunctions.getProperty("aliases.map") + " Create",
|
||||
response.render('map-edit', {
|
||||
headTitle: configFunctions.getProperty('aliases.map') + ' Create',
|
||||
isCreate: true,
|
||||
map,
|
||||
mapSVGs
|
||||
|
|
|
|||
|
|
@ -1,25 +1,25 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import * as configFunctions from "../../helpers/functions.config.js";
|
||||
import * as configFunctions from '../../helpers/functions.config.js'
|
||||
|
||||
import { getMapSVGs } from "../../helpers/functions.map.js";
|
||||
import { getMapSVGs } from '../../helpers/functions.map.js'
|
||||
|
||||
import * as recordTypes from "../../types/recordTypes";
|
||||
import * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
export const handler: RequestHandler = async (_request, response) => {
|
||||
const map: recordTypes.Map = {
|
||||
mapCity: configFunctions.getProperty("settings.map.mapCityDefault"),
|
||||
mapProvince: configFunctions.getProperty("settings.map.mapProvinceDefault")
|
||||
};
|
||||
const map: recordTypes.Map = {
|
||||
mapCity: configFunctions.getProperty('settings.map.mapCityDefault'),
|
||||
mapProvince: configFunctions.getProperty('settings.map.mapProvinceDefault')
|
||||
}
|
||||
|
||||
const mapSVGs = await getMapSVGs();
|
||||
const mapSVGs = await getMapSVGs()
|
||||
|
||||
response.render("map-edit", {
|
||||
headTitle: configFunctions.getProperty("aliases.map") + " Create",
|
||||
isCreate: true,
|
||||
map,
|
||||
mapSVGs
|
||||
});
|
||||
};
|
||||
response.render('map-edit', {
|
||||
headTitle: configFunctions.getProperty('aliases.map') + ' Create',
|
||||
isCreate: true,
|
||||
map,
|
||||
mapSVGs
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import * as configFunctions from "../../helpers/functions.config.js";
|
||||
import { getMaps } from "../../helpers/lotOccupancyDB/getMaps.js";
|
||||
import * as configFunctions from '../../helpers/functions.config.js';
|
||||
import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js';
|
||||
export const handler = (_request, response) => {
|
||||
const maps = getMaps();
|
||||
response.render("map-search", {
|
||||
headTitle: configFunctions.getProperty("aliases.map") + " Search",
|
||||
response.render('map-search', {
|
||||
headTitle: configFunctions.getProperty('aliases.map') + ' Search',
|
||||
maps
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import * as configFunctions from "../../helpers/functions.config.js";
|
||||
import * as configFunctions from '../../helpers/functions.config.js'
|
||||
|
||||
import { getMaps } from "../../helpers/lotOccupancyDB/getMaps.js";
|
||||
import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js'
|
||||
|
||||
export const handler: RequestHandler = (_request, response) => {
|
||||
const maps = getMaps();
|
||||
const maps = getMaps()
|
||||
|
||||
response.render("map-search", {
|
||||
headTitle: configFunctions.getProperty("aliases.map") + " Search",
|
||||
maps
|
||||
});
|
||||
};
|
||||
response.render('map-search', {
|
||||
headTitle: configFunctions.getProperty('aliases.map') + ' Search',
|
||||
maps
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
import * as configFunctions from "../../helpers/functions.config.js";
|
||||
import { getMap } from "../../helpers/lotOccupancyDB/getMap.js";
|
||||
import { getLotStatusSummary } from "../../helpers/lotOccupancyDB/getLotStatusSummary.js";
|
||||
import { getLotTypeSummary } from "../../helpers/lotOccupancyDB/getLotTypeSummary.js";
|
||||
import * as configFunctions from '../../helpers/functions.config.js';
|
||||
import { getMap } from '../../helpers/lotOccupancyDB/getMap.js';
|
||||
import { getLotStatusSummary } from '../../helpers/lotOccupancyDB/getLotStatusSummary.js';
|
||||
import { getLotTypeSummary } from '../../helpers/lotOccupancyDB/getLotTypeSummary.js';
|
||||
export const handler = (request, response) => {
|
||||
const map = getMap(request.params.mapId);
|
||||
if (!map) {
|
||||
return response.redirect(configFunctions.getProperty("reverseProxy.urlPrefix") + "/maps/?error=mapIdNotFound");
|
||||
response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') +
|
||||
'/maps/?error=mapIdNotFound');
|
||||
return;
|
||||
}
|
||||
const lotTypeSummary = getLotTypeSummary({
|
||||
mapId: map.mapId
|
||||
|
|
@ -13,7 +15,7 @@ export const handler = (request, response) => {
|
|||
const lotStatusSummary = getLotStatusSummary({
|
||||
mapId: map.mapId
|
||||
});
|
||||
response.render("map-view", {
|
||||
response.render('map-view', {
|
||||
headTitle: map.mapName,
|
||||
map,
|
||||
lotTypeSummary,
|
||||
|
|
|
|||
|
|
@ -1,34 +1,36 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import * as configFunctions from "../../helpers/functions.config.js";
|
||||
import * as configFunctions from '../../helpers/functions.config.js'
|
||||
|
||||
import { getMap } from "../../helpers/lotOccupancyDB/getMap.js";
|
||||
import { getLotStatusSummary } from "../../helpers/lotOccupancyDB/getLotStatusSummary.js";
|
||||
import { getLotTypeSummary } from "../../helpers/lotOccupancyDB/getLotTypeSummary.js";
|
||||
import { getMap } from '../../helpers/lotOccupancyDB/getMap.js'
|
||||
import { getLotStatusSummary } from '../../helpers/lotOccupancyDB/getLotStatusSummary.js'
|
||||
import { getLotTypeSummary } from '../../helpers/lotOccupancyDB/getLotTypeSummary.js'
|
||||
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const map = getMap(request.params.mapId);
|
||||
const map = getMap(request.params.mapId)
|
||||
|
||||
if (!map) {
|
||||
return response.redirect(
|
||||
configFunctions.getProperty("reverseProxy.urlPrefix") + "/maps/?error=mapIdNotFound"
|
||||
);
|
||||
}
|
||||
if (!map) {
|
||||
response.redirect(
|
||||
configFunctions.getProperty('reverseProxy.urlPrefix') +
|
||||
'/maps/?error=mapIdNotFound'
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
const lotTypeSummary = getLotTypeSummary({
|
||||
mapId: map.mapId
|
||||
});
|
||||
const lotTypeSummary = getLotTypeSummary({
|
||||
mapId: map.mapId
|
||||
})
|
||||
|
||||
const lotStatusSummary = getLotStatusSummary({
|
||||
mapId: map.mapId
|
||||
});
|
||||
const lotStatusSummary = getLotStatusSummary({
|
||||
mapId: map.mapId
|
||||
})
|
||||
|
||||
response.render("map-view", {
|
||||
headTitle: map.mapName,
|
||||
map,
|
||||
lotTypeSummary,
|
||||
lotStatusSummary
|
||||
});
|
||||
};
|
||||
response.render('map-view', {
|
||||
headTitle: map.mapName,
|
||||
map,
|
||||
lotTypeSummary,
|
||||
lotStatusSummary
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { addMap } from "../../helpers/lotOccupancyDB/addMap.js";
|
||||
export const handler = async (request, response) => {
|
||||
import { addMap } from '../../helpers/lotOccupancyDB/addMap.js';
|
||||
export const handler = (request, response) => {
|
||||
const mapId = addMap(request.body, request.session);
|
||||
response.json({
|
||||
success: true,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { addMap } from "../../helpers/lotOccupancyDB/addMap.js";
|
||||
import { addMap } from '../../helpers/lotOccupancyDB/addMap.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const mapId = addMap(request.body, request.session);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const mapId = addMap(request.body, request.session)
|
||||
|
||||
response.json({
|
||||
success: true,
|
||||
mapId
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success: true,
|
||||
mapId
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { deleteRecord } from "../../helpers/lotOccupancyDB/deleteRecord.js";
|
||||
export const handler = async (request, response) => {
|
||||
const success = deleteRecord("Maps", request.body.mapId, request.session);
|
||||
import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js';
|
||||
export const handler = (request, response) => {
|
||||
const success = deleteRecord('Maps', request.body.mapId, request.session);
|
||||
response.json({
|
||||
success
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { deleteRecord } from "../../helpers/lotOccupancyDB/deleteRecord.js";
|
||||
import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const success = deleteRecord("Maps", request.body.mapId, request.session);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const success = deleteRecord('Maps', request.body.mapId, request.session)
|
||||
|
||||
response.json({
|
||||
success
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { updateMap } from "../../helpers/lotOccupancyDB/updateMap.js";
|
||||
export const handler = async (request, response) => {
|
||||
import { updateMap } from '../../helpers/lotOccupancyDB/updateMap.js';
|
||||
export const handler = (request, response) => {
|
||||
const success = updateMap(request.body, request.session);
|
||||
response.json({
|
||||
success,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { updateMap } from "../../helpers/lotOccupancyDB/updateMap.js";
|
||||
import { updateMap } from '../../helpers/lotOccupancyDB/updateMap.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const success = updateMap(request.body, request.session);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const success = updateMap(request.body, request.session)
|
||||
|
||||
response.json({
|
||||
success,
|
||||
mapId: request.body.mapId
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success,
|
||||
mapId: request.body.mapId
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const adminGetHandler: RequestHandler;
|
||||
export declare const adminPostHandler: RequestHandler;
|
||||
export declare const updateGetHandler: RequestHandler;
|
||||
|
|
|
|||
|
|
@ -1,39 +1,44 @@
|
|||
import * as configFunctions from "../helpers/functions.config.js";
|
||||
import * as userFunctions from "../helpers/functions.user.js";
|
||||
const urlPrefix = configFunctions.getProperty("reverseProxy.urlPrefix");
|
||||
import * as configFunctions from '../helpers/functions.config.js';
|
||||
import * as userFunctions from '../helpers/functions.user.js';
|
||||
const urlPrefix = configFunctions.getProperty('reverseProxy.urlPrefix');
|
||||
const forbiddenStatus = 403;
|
||||
const forbiddenJSON = {
|
||||
success: false,
|
||||
message: "Forbidden"
|
||||
message: 'Forbidden'
|
||||
};
|
||||
const forbiddenRedirectURL = urlPrefix + "/dashboard/?error=accessDenied";
|
||||
const forbiddenRedirectURL = urlPrefix + '/dashboard/?error=accessDenied';
|
||||
export const adminGetHandler = (request, response, next) => {
|
||||
if (userFunctions.userIsAdmin(request)) {
|
||||
return next();
|
||||
next();
|
||||
return;
|
||||
}
|
||||
return response.redirect(forbiddenRedirectURL);
|
||||
response.redirect(forbiddenRedirectURL);
|
||||
};
|
||||
export const adminPostHandler = (request, response, next) => {
|
||||
if (userFunctions.userIsAdmin(request)) {
|
||||
return next();
|
||||
next();
|
||||
return;
|
||||
}
|
||||
return response.status(forbiddenStatus).json(forbiddenJSON);
|
||||
};
|
||||
export const updateGetHandler = (request, response, next) => {
|
||||
if (userFunctions.userCanUpdate(request)) {
|
||||
return next();
|
||||
next();
|
||||
return;
|
||||
}
|
||||
return response.redirect(forbiddenRedirectURL);
|
||||
response.redirect(forbiddenRedirectURL);
|
||||
};
|
||||
export const updatePostHandler = (request, response, next) => {
|
||||
if (userFunctions.userCanUpdate(request)) {
|
||||
return next();
|
||||
next();
|
||||
return;
|
||||
}
|
||||
return response.status(forbiddenStatus).json(forbiddenJSON);
|
||||
};
|
||||
export const apiGetHandler = async (request, response, next) => {
|
||||
if (await userFunctions.apiKeyIsValid(request)) {
|
||||
return next();
|
||||
next();
|
||||
return;
|
||||
}
|
||||
return response.redirect(urlPrefix + "/login");
|
||||
response.redirect(urlPrefix + '/login');
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,56 +1,65 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import * as configFunctions from "../helpers/functions.config.js";
|
||||
import * as configFunctions from '../helpers/functions.config.js'
|
||||
|
||||
import * as userFunctions from "../helpers/functions.user.js";
|
||||
import * as userFunctions from '../helpers/functions.user.js'
|
||||
|
||||
const urlPrefix = configFunctions.getProperty("reverseProxy.urlPrefix");
|
||||
const urlPrefix = configFunctions.getProperty('reverseProxy.urlPrefix')
|
||||
|
||||
const forbiddenStatus = 403;
|
||||
const forbiddenStatus = 403
|
||||
|
||||
const forbiddenJSON = {
|
||||
success: false,
|
||||
message: "Forbidden"
|
||||
};
|
||||
success: false,
|
||||
message: 'Forbidden'
|
||||
}
|
||||
|
||||
const forbiddenRedirectURL = urlPrefix + "/dashboard/?error=accessDenied";
|
||||
const forbiddenRedirectURL = urlPrefix + '/dashboard/?error=accessDenied'
|
||||
|
||||
export const adminGetHandler: RequestHandler = (request, response, next) => {
|
||||
if (userFunctions.userIsAdmin(request)) {
|
||||
return next();
|
||||
}
|
||||
if (userFunctions.userIsAdmin(request)) {
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
return response.redirect(forbiddenRedirectURL);
|
||||
};
|
||||
response.redirect(forbiddenRedirectURL)
|
||||
}
|
||||
|
||||
export const adminPostHandler: RequestHandler = (request, response, next) => {
|
||||
if (userFunctions.userIsAdmin(request)) {
|
||||
return next();
|
||||
}
|
||||
if (userFunctions.userIsAdmin(request)) {
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
return response.status(forbiddenStatus).json(forbiddenJSON);
|
||||
};
|
||||
return response.status(forbiddenStatus).json(forbiddenJSON)
|
||||
}
|
||||
|
||||
export const updateGetHandler: RequestHandler = (request, response, next) => {
|
||||
if (userFunctions.userCanUpdate(request)) {
|
||||
return next();
|
||||
}
|
||||
if (userFunctions.userCanUpdate(request)) {
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
return response.redirect(forbiddenRedirectURL);
|
||||
};
|
||||
response.redirect(forbiddenRedirectURL)
|
||||
}
|
||||
|
||||
export const updatePostHandler: RequestHandler = (request, response, next) => {
|
||||
if (userFunctions.userCanUpdate(request)) {
|
||||
return next();
|
||||
}
|
||||
if (userFunctions.userCanUpdate(request)) {
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
return response.status(forbiddenStatus).json(forbiddenJSON);
|
||||
};
|
||||
return response.status(forbiddenStatus).json(forbiddenJSON)
|
||||
}
|
||||
|
||||
export const apiGetHandler: RequestHandler = async (request, response, next) => {
|
||||
if (await userFunctions.apiKeyIsValid(request)) {
|
||||
return next();
|
||||
}
|
||||
export const apiGetHandler: RequestHandler = async (
|
||||
request,
|
||||
response,
|
||||
next
|
||||
) => {
|
||||
if (await userFunctions.apiKeyIsValid(request)) {
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
return response.redirect(urlPrefix + "/login");
|
||||
};
|
||||
response.redirect(urlPrefix + '/login')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,45 +1,51 @@
|
|||
import path from "path";
|
||||
import * as ejs from "ejs";
|
||||
import * as configFunctions from "../../helpers/functions.config.js";
|
||||
import * as dateTimeFunctions from "@cityssm/expressjs-server-js/dateTimeFns.js";
|
||||
import * as lotOccupancyFunctions from "../../helpers/functions.lotOccupancy.js";
|
||||
import { getReportData, getPdfPrintConfig } from "../../helpers/functions.print.js";
|
||||
import { convertHTMLToPDF } from "@cityssm/pdf-puppeteer";
|
||||
import camelcase from "camelcase";
|
||||
const attachmentOrInline = configFunctions.getProperty("settings.printPdf.contentDisposition");
|
||||
import path from 'node:path';
|
||||
import * as ejs from 'ejs';
|
||||
import * as configFunctions from '../../helpers/functions.config.js';
|
||||
import * as dateTimeFunctions from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import * as lotOccupancyFunctions from '../../helpers/functions.lotOccupancy.js';
|
||||
import { getReportData, getPdfPrintConfig } from '../../helpers/functions.print.js';
|
||||
import { convertHTMLToPDF } from '@cityssm/pdf-puppeteer';
|
||||
import camelcase from 'camelcase';
|
||||
const attachmentOrInline = configFunctions.getProperty('settings.printPdf.contentDisposition');
|
||||
export const handler = async (request, response, next) => {
|
||||
const printName = request.params.printName;
|
||||
if (!configFunctions.getProperty("settings.lotOccupancy.prints").includes("pdf/" + printName) &&
|
||||
!configFunctions.getProperty("settings.workOrders.prints").includes("pdf/" + printName)) {
|
||||
return response.redirect(configFunctions.getProperty("reverseProxy.urlPrefix") +
|
||||
"/dashboard/?error=printConfigNotAllowed");
|
||||
if (!configFunctions
|
||||
.getProperty('settings.lotOccupancy.prints')
|
||||
.includes('pdf/' + printName) &&
|
||||
!configFunctions
|
||||
.getProperty('settings.workOrders.prints')
|
||||
.includes('pdf/' + printName)) {
|
||||
response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') +
|
||||
'/dashboard/?error=printConfigNotAllowed');
|
||||
return;
|
||||
}
|
||||
const printConfig = getPdfPrintConfig(printName);
|
||||
if (!printConfig) {
|
||||
return response.redirect(configFunctions.getProperty("reverseProxy.urlPrefix") +
|
||||
"/dashboard/?error=printConfigNotFound");
|
||||
response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') +
|
||||
'/dashboard/?error=printConfigNotFound');
|
||||
return;
|
||||
}
|
||||
const reportData = getReportData(printConfig, request.query);
|
||||
const reportPath = path.join("views", "print", "pdf", printName + ".ejs");
|
||||
const pdfCallbackFunction = (pdf) => {
|
||||
response.setHeader("Content-Disposition", attachmentOrInline + ";" + " filename=" + camelcase(printConfig.title) + ".pdf");
|
||||
response.setHeader("Content-Type", "application/pdf");
|
||||
const reportPath = path.join('views', 'print', 'pdf', printName + '.ejs');
|
||||
function pdfCallbackFunction(pdf) {
|
||||
response.setHeader('Content-Disposition', `${attachmentOrInline}; filename=${camelcase(printConfig.title)}.pdf`);
|
||||
response.setHeader('Content-Type', 'application/pdf');
|
||||
response.send(pdf);
|
||||
};
|
||||
const ejsCallbackFunction = async (ejsError, ejsData) => {
|
||||
}
|
||||
async function ejsCallbackFunction(ejsError, ejsData) {
|
||||
if (ejsError) {
|
||||
return next(ejsError);
|
||||
next(ejsError);
|
||||
return;
|
||||
}
|
||||
await convertHTMLToPDF(ejsData, pdfCallbackFunction, {
|
||||
format: "letter",
|
||||
format: 'letter',
|
||||
printBackground: true,
|
||||
preferCSSPageSize: true
|
||||
}, undefined, {
|
||||
cacheBrowser: true,
|
||||
remoteContent: false
|
||||
});
|
||||
return;
|
||||
};
|
||||
}
|
||||
reportData.configFunctions = configFunctions;
|
||||
reportData.dateTimeFunctions = dateTimeFunctions;
|
||||
reportData.lotOccupancyFunctions = lotOccupancyFunctions;
|
||||
|
|
|
|||
|
|
@ -1,84 +1,97 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import path from "path";
|
||||
import * as ejs from "ejs";
|
||||
import path from 'node:path'
|
||||
import * as ejs from 'ejs'
|
||||
|
||||
import * as configFunctions from "../../helpers/functions.config.js";
|
||||
import * as dateTimeFunctions from "@cityssm/expressjs-server-js/dateTimeFns.js";
|
||||
import * as lotOccupancyFunctions from "../../helpers/functions.lotOccupancy.js";
|
||||
import * as configFunctions from '../../helpers/functions.config.js'
|
||||
import * as dateTimeFunctions from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
import * as lotOccupancyFunctions from '../../helpers/functions.lotOccupancy.js'
|
||||
|
||||
import { getReportData, getPdfPrintConfig } from "../../helpers/functions.print.js";
|
||||
import {
|
||||
getReportData,
|
||||
getPdfPrintConfig
|
||||
} from '../../helpers/functions.print.js'
|
||||
|
||||
import { convertHTMLToPDF } from "@cityssm/pdf-puppeteer";
|
||||
import camelcase from "camelcase";
|
||||
import { convertHTMLToPDF } from '@cityssm/pdf-puppeteer'
|
||||
import camelcase from 'camelcase'
|
||||
|
||||
const attachmentOrInline = configFunctions.getProperty("settings.printPdf.contentDisposition");
|
||||
const attachmentOrInline = configFunctions.getProperty(
|
||||
'settings.printPdf.contentDisposition'
|
||||
)
|
||||
|
||||
export const handler: RequestHandler = async (request, response, next) => {
|
||||
const printName = request.params.printName;
|
||||
const printName = request.params.printName
|
||||
|
||||
if (
|
||||
!configFunctions.getProperty("settings.lotOccupancy.prints").includes("pdf/" + printName) &&
|
||||
!configFunctions.getProperty("settings.workOrders.prints").includes("pdf/" + printName)
|
||||
) {
|
||||
return response.redirect(
|
||||
configFunctions.getProperty("reverseProxy.urlPrefix") +
|
||||
"/dashboard/?error=printConfigNotAllowed"
|
||||
);
|
||||
if (
|
||||
!configFunctions
|
||||
.getProperty('settings.lotOccupancy.prints')
|
||||
.includes('pdf/' + printName) &&
|
||||
!configFunctions
|
||||
.getProperty('settings.workOrders.prints')
|
||||
.includes('pdf/' + printName)
|
||||
) {
|
||||
response.redirect(
|
||||
configFunctions.getProperty('reverseProxy.urlPrefix') +
|
||||
'/dashboard/?error=printConfigNotAllowed'
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
const printConfig = getPdfPrintConfig(printName)
|
||||
|
||||
if (!printConfig) {
|
||||
response.redirect(
|
||||
configFunctions.getProperty('reverseProxy.urlPrefix') +
|
||||
'/dashboard/?error=printConfigNotFound'
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
const reportData = getReportData(printConfig, request.query)
|
||||
|
||||
const reportPath = path.join('views', 'print', 'pdf', printName + '.ejs')
|
||||
|
||||
function pdfCallbackFunction(pdf: Buffer): void {
|
||||
response.setHeader(
|
||||
'Content-Disposition',
|
||||
`${attachmentOrInline}; filename=${camelcase(printConfig.title)}.pdf`
|
||||
)
|
||||
|
||||
response.setHeader('Content-Type', 'application/pdf')
|
||||
|
||||
response.send(pdf)
|
||||
}
|
||||
|
||||
async function ejsCallbackFunction(
|
||||
ejsError: Error,
|
||||
ejsData: string
|
||||
): Promise<void> {
|
||||
if (ejsError) {
|
||||
next(ejsError)
|
||||
return
|
||||
}
|
||||
|
||||
const printConfig = getPdfPrintConfig(printName);
|
||||
await convertHTMLToPDF(
|
||||
ejsData,
|
||||
pdfCallbackFunction,
|
||||
{
|
||||
format: 'letter',
|
||||
printBackground: true,
|
||||
preferCSSPageSize: true
|
||||
},
|
||||
undefined,
|
||||
{
|
||||
cacheBrowser: true,
|
||||
remoteContent: false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
if (!printConfig) {
|
||||
return response.redirect(
|
||||
configFunctions.getProperty("reverseProxy.urlPrefix") +
|
||||
"/dashboard/?error=printConfigNotFound"
|
||||
);
|
||||
}
|
||||
reportData.configFunctions = configFunctions
|
||||
reportData.dateTimeFunctions = dateTimeFunctions
|
||||
reportData.lotOccupancyFunctions = lotOccupancyFunctions
|
||||
|
||||
const reportData = getReportData(printConfig, request.query);
|
||||
await ejs.renderFile(reportPath, reportData, {}, ejsCallbackFunction)
|
||||
}
|
||||
|
||||
const reportPath = path.join("views", "print", "pdf", printName + ".ejs");
|
||||
|
||||
const pdfCallbackFunction = (pdf: Buffer) => {
|
||||
response.setHeader(
|
||||
"Content-Disposition",
|
||||
attachmentOrInline + ";" + " filename=" + camelcase(printConfig.title) + ".pdf"
|
||||
);
|
||||
|
||||
response.setHeader("Content-Type", "application/pdf");
|
||||
|
||||
response.send(pdf);
|
||||
};
|
||||
|
||||
const ejsCallbackFunction = async (ejsError: Error, ejsData: string) => {
|
||||
if (ejsError) {
|
||||
return next(ejsError);
|
||||
}
|
||||
|
||||
await convertHTMLToPDF(
|
||||
ejsData,
|
||||
pdfCallbackFunction,
|
||||
{
|
||||
format: "letter",
|
||||
printBackground: true,
|
||||
preferCSSPageSize: true
|
||||
},
|
||||
undefined,
|
||||
{
|
||||
cacheBrowser: true,
|
||||
remoteContent: false
|
||||
}
|
||||
);
|
||||
|
||||
return;
|
||||
};
|
||||
|
||||
reportData.configFunctions = configFunctions;
|
||||
reportData.dateTimeFunctions = dateTimeFunctions;
|
||||
reportData.lotOccupancyFunctions = lotOccupancyFunctions;
|
||||
|
||||
await ejs.renderFile(reportPath, reportData, {}, ejsCallbackFunction);
|
||||
};
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import * as dateTimeFunctions from "@cityssm/expressjs-server-js/dateTimeFns.js";
|
||||
import { getMaps } from "../../helpers/lotOccupancyDB/getMaps.js";
|
||||
import { getLotStatuses, getLotTypes } from "../../helpers/functions.cache.js";
|
||||
import * as dateTimeFunctions from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js';
|
||||
import { getLotStatuses, getLotTypes } from '../../helpers/functions.cache.js';
|
||||
export const handler = (_request, response) => {
|
||||
const rightNow = new Date();
|
||||
const maps = getMaps();
|
||||
const lotTypes = getLotTypes();
|
||||
const lotStatuses = getLotStatuses();
|
||||
response.render("report-search", {
|
||||
headTitle: "Reports",
|
||||
response.render('report-search', {
|
||||
headTitle: 'Reports',
|
||||
todayDateString: dateTimeFunctions.dateToString(rightNow),
|
||||
maps,
|
||||
lotTypes,
|
||||
|
|
|
|||
|
|
@ -1,24 +1,24 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import * as dateTimeFunctions from "@cityssm/expressjs-server-js/dateTimeFns.js";
|
||||
import * as dateTimeFunctions from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
|
||||
import { getMaps } from "../../helpers/lotOccupancyDB/getMaps.js";
|
||||
import { getLotStatuses, getLotTypes } from "../../helpers/functions.cache.js";
|
||||
import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js'
|
||||
import { getLotStatuses, getLotTypes } from '../../helpers/functions.cache.js'
|
||||
|
||||
export const handler: RequestHandler = (_request, response) => {
|
||||
const rightNow = new Date();
|
||||
const rightNow = new Date()
|
||||
|
||||
const maps = getMaps();
|
||||
const lotTypes = getLotTypes();
|
||||
const lotStatuses = getLotStatuses();
|
||||
const maps = getMaps()
|
||||
const lotTypes = getLotTypes()
|
||||
const lotStatuses = getLotStatuses()
|
||||
|
||||
response.render("report-search", {
|
||||
headTitle: "Reports",
|
||||
todayDateString: dateTimeFunctions.dateToString(rightNow),
|
||||
maps,
|
||||
lotTypes,
|
||||
lotStatuses
|
||||
});
|
||||
};
|
||||
response.render('report-search', {
|
||||
headTitle: 'Reports',
|
||||
todayDateString: dateTimeFunctions.dateToString(rightNow),
|
||||
maps,
|
||||
lotTypes,
|
||||
lotStatuses
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
export const handler = (request, response) => {
|
||||
response.render("workOrder-milestoneCalendar", {
|
||||
headTitle: "Work Order Milestone Calendar"
|
||||
response.render('workOrder-milestoneCalendar', {
|
||||
headTitle: 'Work Order Milestone Calendar'
|
||||
});
|
||||
};
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
response.render("workOrder-milestoneCalendar", {
|
||||
headTitle: "Work Order Milestone Calendar"
|
||||
});
|
||||
};
|
||||
response.render('workOrder-milestoneCalendar', {
|
||||
headTitle: 'Work Order Milestone Calendar'
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { dateToInteger, dateToString } from "@cityssm/expressjs-server-js/dateTimeFns.js";
|
||||
import { getWorkOrderTypes } from "../../helpers/functions.cache.js";
|
||||
import { dateToInteger, dateToString } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
import { getWorkOrderTypes } from '../../helpers/functions.cache.js';
|
||||
export const handler = (request, response) => {
|
||||
const currentDate = new Date();
|
||||
const workOrder = {
|
||||
|
|
@ -7,8 +7,8 @@ export const handler = (request, response) => {
|
|||
workOrderOpenDateString: dateToString(currentDate)
|
||||
};
|
||||
const workOrderTypes = getWorkOrderTypes();
|
||||
response.render("workOrder-edit", {
|
||||
headTitle: "New Work Order",
|
||||
response.render('workOrder-edit', {
|
||||
headTitle: 'New Work Order',
|
||||
workOrder,
|
||||
isCreate: true,
|
||||
workOrderTypes
|
||||
|
|
|
|||
|
|
@ -1,26 +1,29 @@
|
|||
import { dateToInteger, dateToString } from "@cityssm/expressjs-server-js/dateTimeFns.js";
|
||||
import type { RequestHandler } from "express";
|
||||
import {
|
||||
dateToInteger,
|
||||
dateToString
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { getWorkOrderTypes } from "../../helpers/functions.cache.js";
|
||||
import { getWorkOrderTypes } from '../../helpers/functions.cache.js'
|
||||
|
||||
import * as recordTypes from "../../types/recordTypes";
|
||||
import * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const currentDate = new Date();
|
||||
const currentDate = new Date()
|
||||
|
||||
const workOrder: recordTypes.WorkOrder = {
|
||||
workOrderOpenDate: dateToInteger(currentDate),
|
||||
workOrderOpenDateString: dateToString(currentDate)
|
||||
};
|
||||
const workOrder: recordTypes.WorkOrder = {
|
||||
workOrderOpenDate: dateToInteger(currentDate),
|
||||
workOrderOpenDateString: dateToString(currentDate)
|
||||
}
|
||||
|
||||
const workOrderTypes = getWorkOrderTypes();
|
||||
const workOrderTypes = getWorkOrderTypes()
|
||||
|
||||
response.render("workOrder-edit", {
|
||||
headTitle: "New Work Order",
|
||||
workOrder,
|
||||
isCreate: true,
|
||||
workOrderTypes
|
||||
});
|
||||
};
|
||||
response.render('workOrder-edit', {
|
||||
headTitle: 'New Work Order',
|
||||
workOrder,
|
||||
isCreate: true,
|
||||
workOrderTypes
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { getWorkOrderMilestoneTypes, getWorkOrderTypes } from "../../helpers/functions.cache.js";
|
||||
import { getWorkOrderMilestoneTypes, getWorkOrderTypes } from '../../helpers/functions.cache.js';
|
||||
export const handler = (request, response) => {
|
||||
const workOrderTypes = getWorkOrderTypes();
|
||||
const workOrderMilestoneTypes = getWorkOrderMilestoneTypes();
|
||||
response.render("workOrder-outlook", {
|
||||
headTitle: "Work Order Outlook Integration",
|
||||
response.render('workOrder-outlook', {
|
||||
headTitle: 'Work Order Outlook Integration',
|
||||
workOrderTypes,
|
||||
workOrderMilestoneTypes
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,16 +1,19 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { getWorkOrderMilestoneTypes, getWorkOrderTypes } from "../../helpers/functions.cache.js";
|
||||
import {
|
||||
getWorkOrderMilestoneTypes,
|
||||
getWorkOrderTypes
|
||||
} from '../../helpers/functions.cache.js'
|
||||
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const workOrderTypes = getWorkOrderTypes();
|
||||
const workOrderMilestoneTypes = getWorkOrderMilestoneTypes();
|
||||
const workOrderTypes = getWorkOrderTypes()
|
||||
const workOrderMilestoneTypes = getWorkOrderMilestoneTypes()
|
||||
|
||||
response.render("workOrder-outlook", {
|
||||
headTitle: "Work Order Outlook Integration",
|
||||
workOrderTypes,
|
||||
workOrderMilestoneTypes
|
||||
});
|
||||
};
|
||||
response.render('workOrder-outlook', {
|
||||
headTitle: 'Work Order Outlook Integration',
|
||||
workOrderTypes,
|
||||
workOrderMilestoneTypes
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { getWorkOrderTypes } from "../../helpers/functions.cache.js";
|
||||
import { getWorkOrderTypes } from '../../helpers/functions.cache.js';
|
||||
export const handler = (request, response) => {
|
||||
const workOrderOpenDateString = request.query.workOrderOpenDateString;
|
||||
const workOrderTypes = getWorkOrderTypes();
|
||||
response.render("workOrder-search", {
|
||||
headTitle: "Work Order Search",
|
||||
response.render('workOrder-search', {
|
||||
headTitle: 'Work Order Search',
|
||||
workOrderTypes,
|
||||
workOrderOpenDateString
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { getWorkOrderTypes } from "../../helpers/functions.cache.js";
|
||||
import { getWorkOrderTypes } from '../../helpers/functions.cache.js'
|
||||
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const workOrderOpenDateString = request.query.workOrderOpenDateString;
|
||||
const workOrderOpenDateString = request.query.workOrderOpenDateString
|
||||
|
||||
const workOrderTypes = getWorkOrderTypes();
|
||||
const workOrderTypes = getWorkOrderTypes()
|
||||
|
||||
response.render("workOrder-search", {
|
||||
headTitle: "Work Order Search",
|
||||
workOrderTypes,
|
||||
workOrderOpenDateString
|
||||
});
|
||||
};
|
||||
response.render('workOrder-search', {
|
||||
headTitle: 'Work Order Search',
|
||||
workOrderTypes,
|
||||
workOrderOpenDateString
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import * as configFunctions from "../../helpers/functions.config.js";
|
||||
import { getWorkOrder } from "../../helpers/lotOccupancyDB/getWorkOrder.js";
|
||||
import * as configFunctions from '../../helpers/functions.config.js';
|
||||
import { getWorkOrder } from '../../helpers/lotOccupancyDB/getWorkOrder.js';
|
||||
export const handler = (request, response) => {
|
||||
const workOrder = getWorkOrder(request.params.workOrderId, {
|
||||
includeLotsAndLotOccupancies: true,
|
||||
|
|
@ -7,11 +7,12 @@ export const handler = (request, response) => {
|
|||
includeMilestones: true
|
||||
});
|
||||
if (!workOrder) {
|
||||
return response.redirect(configFunctions.getProperty("reverseProxy.urlPrefix") +
|
||||
"/workOrders/?error=workOrderIdNotFound");
|
||||
response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') +
|
||||
'/workOrders/?error=workOrderIdNotFound');
|
||||
return;
|
||||
}
|
||||
response.render("workOrder-view", {
|
||||
headTitle: "Work Order #" + workOrder.workOrderNumber,
|
||||
response.render('workOrder-view', {
|
||||
headTitle: `Work Order #${workOrder.workOrderNumber}`,
|
||||
workOrder
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,27 +1,28 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import * as configFunctions from "../../helpers/functions.config.js";
|
||||
import * as configFunctions from '../../helpers/functions.config.js'
|
||||
|
||||
import { getWorkOrder } from "../../helpers/lotOccupancyDB/getWorkOrder.js";
|
||||
import { getWorkOrder } from '../../helpers/lotOccupancyDB/getWorkOrder.js'
|
||||
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const workOrder = getWorkOrder(request.params.workOrderId, {
|
||||
includeLotsAndLotOccupancies: true,
|
||||
includeComments: true,
|
||||
includeMilestones: true
|
||||
});
|
||||
const workOrder = getWorkOrder(request.params.workOrderId, {
|
||||
includeLotsAndLotOccupancies: true,
|
||||
includeComments: true,
|
||||
includeMilestones: true
|
||||
})
|
||||
|
||||
if (!workOrder) {
|
||||
return response.redirect(
|
||||
configFunctions.getProperty("reverseProxy.urlPrefix") +
|
||||
"/workOrders/?error=workOrderIdNotFound"
|
||||
);
|
||||
}
|
||||
if (!workOrder) {
|
||||
response.redirect(
|
||||
configFunctions.getProperty('reverseProxy.urlPrefix') +
|
||||
'/workOrders/?error=workOrderIdNotFound'
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
response.render("workOrder-view", {
|
||||
headTitle: "Work Order #" + workOrder.workOrderNumber,
|
||||
workOrder
|
||||
});
|
||||
};
|
||||
response.render('workOrder-view', {
|
||||
headTitle: `Work Order #${workOrder.workOrderNumber!}`,
|
||||
workOrder
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { addWorkOrderComment } from "../../helpers/lotOccupancyDB/addWorkOrderComment.js";
|
||||
import { getWorkOrderComments } from "../../helpers/lotOccupancyDB/getWorkOrderComments.js";
|
||||
export const handler = async (request, response) => {
|
||||
import { addWorkOrderComment } from '../../helpers/lotOccupancyDB/addWorkOrderComment.js';
|
||||
import { getWorkOrderComments } from '../../helpers/lotOccupancyDB/getWorkOrderComments.js';
|
||||
export const handler = (request, response) => {
|
||||
addWorkOrderComment(request.body, request.session);
|
||||
const workOrderComments = getWorkOrderComments(request.body.workOrderId);
|
||||
response.json({
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { addWorkOrderComment } from "../../helpers/lotOccupancyDB/addWorkOrderComment.js";
|
||||
import { addWorkOrderComment } from '../../helpers/lotOccupancyDB/addWorkOrderComment.js'
|
||||
|
||||
import { getWorkOrderComments } from "../../helpers/lotOccupancyDB/getWorkOrderComments.js";
|
||||
import { getWorkOrderComments } from '../../helpers/lotOccupancyDB/getWorkOrderComments.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
addWorkOrderComment(request.body, request.session);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
addWorkOrderComment(request.body, request.session)
|
||||
|
||||
const workOrderComments = getWorkOrderComments(request.body.workOrderId);
|
||||
const workOrderComments = getWorkOrderComments(request.body.workOrderId)
|
||||
|
||||
response.json({
|
||||
success: true,
|
||||
workOrderComments
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success: true,
|
||||
workOrderComments
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { addWorkOrderLot } from "../../helpers/lotOccupancyDB/addWorkOrderLot.js";
|
||||
import { getLots } from "../../helpers/lotOccupancyDB/getLots.js";
|
||||
export const handler = async (request, response) => {
|
||||
import { addWorkOrderLot } from '../../helpers/lotOccupancyDB/addWorkOrderLot.js';
|
||||
import { getLots } from '../../helpers/lotOccupancyDB/getLots.js';
|
||||
export const handler = (request, response) => {
|
||||
const success = addWorkOrderLot({
|
||||
workOrderId: request.body.workOrderId,
|
||||
lotId: request.body.lotId
|
||||
|
|
|
|||
|
|
@ -1,31 +1,31 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { addWorkOrderLot } from "../../helpers/lotOccupancyDB/addWorkOrderLot.js";
|
||||
import { getLots } from "../../helpers/lotOccupancyDB/getLots.js";
|
||||
import { addWorkOrderLot } from '../../helpers/lotOccupancyDB/addWorkOrderLot.js'
|
||||
import { getLots } from '../../helpers/lotOccupancyDB/getLots.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const success = addWorkOrderLot(
|
||||
{
|
||||
workOrderId: request.body.workOrderId,
|
||||
lotId: request.body.lotId
|
||||
},
|
||||
request.session
|
||||
);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const success = addWorkOrderLot(
|
||||
{
|
||||
workOrderId: request.body.workOrderId,
|
||||
lotId: request.body.lotId
|
||||
},
|
||||
request.session
|
||||
)
|
||||
|
||||
const workOrderLots = getLots(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
limit: -1,
|
||||
offset: 0
|
||||
}
|
||||
).lots;
|
||||
const workOrderLots = getLots(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
limit: -1,
|
||||
offset: 0
|
||||
}
|
||||
).lots
|
||||
|
||||
response.json({
|
||||
success,
|
||||
workOrderLots
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success,
|
||||
workOrderLots
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { addWorkOrderLotOccupancy } from "../../helpers/lotOccupancyDB/addWorkOrderLotOccupancy.js";
|
||||
import { getLotOccupancies } from "../../helpers/lotOccupancyDB/getLotOccupancies.js";
|
||||
export const handler = async (request, response) => {
|
||||
import { addWorkOrderLotOccupancy } from '../../helpers/lotOccupancyDB/addWorkOrderLotOccupancy.js';
|
||||
import { getLotOccupancies } from '../../helpers/lotOccupancyDB/getLotOccupancies.js';
|
||||
export const handler = (request, response) => {
|
||||
const success = addWorkOrderLotOccupancy({
|
||||
workOrderId: request.body.workOrderId,
|
||||
lotOccupancyId: request.body.lotOccupancyId
|
||||
|
|
|
|||
|
|
@ -1,32 +1,32 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { addWorkOrderLotOccupancy } from "../../helpers/lotOccupancyDB/addWorkOrderLotOccupancy.js";
|
||||
import { getLotOccupancies } from "../../helpers/lotOccupancyDB/getLotOccupancies.js";
|
||||
import { addWorkOrderLotOccupancy } from '../../helpers/lotOccupancyDB/addWorkOrderLotOccupancy.js'
|
||||
import { getLotOccupancies } from '../../helpers/lotOccupancyDB/getLotOccupancies.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const success = addWorkOrderLotOccupancy(
|
||||
{
|
||||
workOrderId: request.body.workOrderId,
|
||||
lotOccupancyId: request.body.lotOccupancyId
|
||||
},
|
||||
request.session
|
||||
);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const success = addWorkOrderLotOccupancy(
|
||||
{
|
||||
workOrderId: request.body.workOrderId,
|
||||
lotOccupancyId: request.body.lotOccupancyId
|
||||
},
|
||||
request.session
|
||||
)
|
||||
|
||||
const workOrderLotOccupancies = getLotOccupancies(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
limit: -1,
|
||||
offset: 0,
|
||||
includeOccupants: true
|
||||
}
|
||||
).lotOccupancies;
|
||||
const workOrderLotOccupancies = getLotOccupancies(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
limit: -1,
|
||||
offset: 0,
|
||||
includeOccupants: true
|
||||
}
|
||||
).lotOccupancies
|
||||
|
||||
response.json({
|
||||
success,
|
||||
workOrderLotOccupancies
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success,
|
||||
workOrderLotOccupancies
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { addWorkOrderMilestone } from "../../helpers/lotOccupancyDB/addWorkOrderMilestone.js";
|
||||
import { getWorkOrderMilestones } from "../../helpers/lotOccupancyDB/getWorkOrderMilestones.js";
|
||||
export const handler = async (request, response) => {
|
||||
import { addWorkOrderMilestone } from '../../helpers/lotOccupancyDB/addWorkOrderMilestone.js';
|
||||
import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js';
|
||||
export const handler = (request, response) => {
|
||||
const success = addWorkOrderMilestone(request.body, request.session);
|
||||
const workOrderMilestones = getWorkOrderMilestones({
|
||||
workOrderId: request.body.workOrderId
|
||||
}, {
|
||||
orderBy: "completion"
|
||||
orderBy: 'completion'
|
||||
});
|
||||
response.json({
|
||||
success,
|
||||
|
|
|
|||
|
|
@ -1,24 +1,24 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { addWorkOrderMilestone } from "../../helpers/lotOccupancyDB/addWorkOrderMilestone.js";
|
||||
import { getWorkOrderMilestones } from "../../helpers/lotOccupancyDB/getWorkOrderMilestones.js";
|
||||
import { addWorkOrderMilestone } from '../../helpers/lotOccupancyDB/addWorkOrderMilestone.js'
|
||||
import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const success = addWorkOrderMilestone(request.body, request.session);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const success = addWorkOrderMilestone(request.body, request.session)
|
||||
|
||||
const workOrderMilestones = getWorkOrderMilestones(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
orderBy: "completion"
|
||||
}
|
||||
);
|
||||
const workOrderMilestones = getWorkOrderMilestones(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
orderBy: 'completion'
|
||||
}
|
||||
)
|
||||
|
||||
response.json({
|
||||
success,
|
||||
workOrderMilestones
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success,
|
||||
workOrderMilestones
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { closeWorkOrder } from "../../helpers/lotOccupancyDB/closeWorkOrder.js";
|
||||
export const handler = async (request, response) => {
|
||||
import { closeWorkOrder } from '../../helpers/lotOccupancyDB/closeWorkOrder.js';
|
||||
export const handler = (request, response) => {
|
||||
const success = closeWorkOrder(request.body, request.session);
|
||||
response.json({
|
||||
success
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { closeWorkOrder } from "../../helpers/lotOccupancyDB/closeWorkOrder.js";
|
||||
import { closeWorkOrder } from '../../helpers/lotOccupancyDB/closeWorkOrder.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const success = closeWorkOrder(
|
||||
request.body,
|
||||
request.session
|
||||
);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const success = closeWorkOrder(request.body, request.session)
|
||||
|
||||
response.json({
|
||||
success
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { completeWorkOrderMilestone } from "../../helpers/lotOccupancyDB/completeWorkOrderMilestone.js";
|
||||
import { getWorkOrderMilestones } from "../../helpers/lotOccupancyDB/getWorkOrderMilestones.js";
|
||||
export const handler = async (request, response) => {
|
||||
import { completeWorkOrderMilestone } from '../../helpers/lotOccupancyDB/completeWorkOrderMilestone.js';
|
||||
import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js';
|
||||
export const handler = (request, response) => {
|
||||
const success = completeWorkOrderMilestone({
|
||||
workOrderMilestoneId: request.body.workOrderMilestoneId
|
||||
}, request.session);
|
||||
const workOrderMilestones = getWorkOrderMilestones({
|
||||
workOrderId: request.body.workOrderId
|
||||
}, {
|
||||
orderBy: "completion"
|
||||
orderBy: 'completion'
|
||||
});
|
||||
response.json({
|
||||
success,
|
||||
|
|
|
|||
|
|
@ -1,30 +1,30 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { completeWorkOrderMilestone } from "../../helpers/lotOccupancyDB/completeWorkOrderMilestone.js";
|
||||
import { completeWorkOrderMilestone } from '../../helpers/lotOccupancyDB/completeWorkOrderMilestone.js'
|
||||
|
||||
import { getWorkOrderMilestones } from "../../helpers/lotOccupancyDB/getWorkOrderMilestones.js";
|
||||
import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const success = completeWorkOrderMilestone(
|
||||
{
|
||||
workOrderMilestoneId: request.body.workOrderMilestoneId
|
||||
},
|
||||
request.session
|
||||
);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const success = completeWorkOrderMilestone(
|
||||
{
|
||||
workOrderMilestoneId: request.body.workOrderMilestoneId
|
||||
},
|
||||
request.session
|
||||
)
|
||||
|
||||
const workOrderMilestones = getWorkOrderMilestones(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
orderBy: "completion"
|
||||
}
|
||||
);
|
||||
const workOrderMilestones = getWorkOrderMilestones(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
orderBy: 'completion'
|
||||
}
|
||||
)
|
||||
|
||||
response.json({
|
||||
success,
|
||||
workOrderMilestones
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success,
|
||||
workOrderMilestones
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { addWorkOrder } from "../../helpers/lotOccupancyDB/addWorkOrder.js";
|
||||
export const handler = async (request, response) => {
|
||||
import { addWorkOrder } from '../../helpers/lotOccupancyDB/addWorkOrder.js';
|
||||
export const handler = (request, response) => {
|
||||
const workOrderId = addWorkOrder(request.body, request.session);
|
||||
response.json({
|
||||
success: true,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { addWorkOrder } from "../../helpers/lotOccupancyDB/addWorkOrder.js";
|
||||
import { addWorkOrder } from '../../helpers/lotOccupancyDB/addWorkOrder.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const workOrderId = addWorkOrder(request.body, request.session);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const workOrderId = addWorkOrder(request.body, request.session)
|
||||
|
||||
response.json({
|
||||
success: true,
|
||||
workOrderId
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success: true,
|
||||
workOrderId
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { deleteRecord } from "../../helpers/lotOccupancyDB/deleteRecord.js";
|
||||
export const handler = async (request, response) => {
|
||||
const success = deleteRecord("WorkOrders", request.body.workOrderId, request.session);
|
||||
import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js';
|
||||
export const handler = (request, response) => {
|
||||
const success = deleteRecord('WorkOrders', request.body.workOrderId, request.session);
|
||||
response.json({
|
||||
success
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,13 +1,17 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { deleteRecord } from "../../helpers/lotOccupancyDB/deleteRecord.js";
|
||||
import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const success = deleteRecord("WorkOrders", request.body.workOrderId, request.session);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const success = deleteRecord(
|
||||
'WorkOrders',
|
||||
request.body.workOrderId,
|
||||
request.session
|
||||
)
|
||||
|
||||
response.json({
|
||||
success
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { deleteRecord } from "../../helpers/lotOccupancyDB/deleteRecord.js";
|
||||
import { getWorkOrderComments } from "../../helpers/lotOccupancyDB/getWorkOrderComments.js";
|
||||
export const handler = async (request, response) => {
|
||||
const success = deleteRecord("WorkOrderComments", request.body.workOrderCommentId, request.session);
|
||||
import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js';
|
||||
import { getWorkOrderComments } from '../../helpers/lotOccupancyDB/getWorkOrderComments.js';
|
||||
export const handler = (request, response) => {
|
||||
const success = deleteRecord('WorkOrderComments', request.body.workOrderCommentId, request.session);
|
||||
const workOrderComments = getWorkOrderComments(request.body.workOrderId);
|
||||
response.json({
|
||||
success,
|
||||
|
|
|
|||
|
|
@ -1,18 +1,22 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { deleteRecord } from "../../helpers/lotOccupancyDB/deleteRecord.js";
|
||||
import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'
|
||||
|
||||
import { getWorkOrderComments } from "../../helpers/lotOccupancyDB/getWorkOrderComments.js";
|
||||
import { getWorkOrderComments } from '../../helpers/lotOccupancyDB/getWorkOrderComments.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const success = deleteRecord("WorkOrderComments", request.body.workOrderCommentId, request.session);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const success = deleteRecord(
|
||||
'WorkOrderComments',
|
||||
request.body.workOrderCommentId,
|
||||
request.session
|
||||
)
|
||||
|
||||
const workOrderComments = getWorkOrderComments(request.body.workOrderId);
|
||||
const workOrderComments = getWorkOrderComments(request.body.workOrderId)
|
||||
|
||||
response.json({
|
||||
success,
|
||||
workOrderComments
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success,
|
||||
workOrderComments
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { deleteWorkOrderLot } from "../../helpers/lotOccupancyDB/deleteWorkOrderLot.js";
|
||||
import { getLots } from "../../helpers/lotOccupancyDB/getLots.js";
|
||||
export const handler = async (request, response) => {
|
||||
import { deleteWorkOrderLot } from '../../helpers/lotOccupancyDB/deleteWorkOrderLot.js';
|
||||
import { getLots } from '../../helpers/lotOccupancyDB/getLots.js';
|
||||
export const handler = (request, response) => {
|
||||
const success = deleteWorkOrderLot(request.body.workOrderId, request.body.lotId, request.session);
|
||||
const workOrderLots = getLots({
|
||||
workOrderId: request.body.workOrderId
|
||||
|
|
|
|||
|
|
@ -1,29 +1,29 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { deleteWorkOrderLot } from "../../helpers/lotOccupancyDB/deleteWorkOrderLot.js";
|
||||
import { getLots } from "../../helpers/lotOccupancyDB/getLots.js";
|
||||
import { deleteWorkOrderLot } from '../../helpers/lotOccupancyDB/deleteWorkOrderLot.js'
|
||||
import { getLots } from '../../helpers/lotOccupancyDB/getLots.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const success = deleteWorkOrderLot(
|
||||
request.body.workOrderId,
|
||||
request.body.lotId,
|
||||
request.session
|
||||
);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const success = deleteWorkOrderLot(
|
||||
request.body.workOrderId,
|
||||
request.body.lotId,
|
||||
request.session
|
||||
)
|
||||
|
||||
const workOrderLots = getLots(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
limit: -1,
|
||||
offset: 0
|
||||
}
|
||||
).lots;
|
||||
const workOrderLots = getLots(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
limit: -1,
|
||||
offset: 0
|
||||
}
|
||||
).lots
|
||||
|
||||
response.json({
|
||||
success,
|
||||
workOrderLots
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success,
|
||||
workOrderLots
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { deleteWorkOrderLotOccupancy } from "../../helpers/lotOccupancyDB/deleteWorkOrderLotOccupancy.js";
|
||||
import { getLotOccupancies } from "../../helpers/lotOccupancyDB/getLotOccupancies.js";
|
||||
export const handler = async (request, response) => {
|
||||
import { deleteWorkOrderLotOccupancy } from '../../helpers/lotOccupancyDB/deleteWorkOrderLotOccupancy.js';
|
||||
import { getLotOccupancies } from '../../helpers/lotOccupancyDB/getLotOccupancies.js';
|
||||
export const handler = (request, response) => {
|
||||
const success = deleteWorkOrderLotOccupancy(request.body.workOrderId, request.body.lotOccupancyId, request.session);
|
||||
const workOrderLotOccupancies = getLotOccupancies({
|
||||
workOrderId: request.body.workOrderId
|
||||
|
|
|
|||
|
|
@ -1,30 +1,30 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { deleteWorkOrderLotOccupancy } from "../../helpers/lotOccupancyDB/deleteWorkOrderLotOccupancy.js";
|
||||
import { getLotOccupancies } from "../../helpers/lotOccupancyDB/getLotOccupancies.js";
|
||||
import { deleteWorkOrderLotOccupancy } from '../../helpers/lotOccupancyDB/deleteWorkOrderLotOccupancy.js'
|
||||
import { getLotOccupancies } from '../../helpers/lotOccupancyDB/getLotOccupancies.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const success = deleteWorkOrderLotOccupancy(
|
||||
request.body.workOrderId,
|
||||
request.body.lotOccupancyId,
|
||||
request.session
|
||||
);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const success = deleteWorkOrderLotOccupancy(
|
||||
request.body.workOrderId,
|
||||
request.body.lotOccupancyId,
|
||||
request.session
|
||||
)
|
||||
|
||||
const workOrderLotOccupancies = getLotOccupancies(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
limit: -1,
|
||||
offset: 0,
|
||||
includeOccupants: true
|
||||
}
|
||||
).lotOccupancies;
|
||||
const workOrderLotOccupancies = getLotOccupancies(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
limit: -1,
|
||||
offset: 0,
|
||||
includeOccupants: true
|
||||
}
|
||||
).lotOccupancies
|
||||
|
||||
response.json({
|
||||
success,
|
||||
workOrderLotOccupancies
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success,
|
||||
workOrderLotOccupancies
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { deleteRecord } from "../../helpers/lotOccupancyDB/deleteRecord.js";
|
||||
import { getWorkOrderMilestones } from "../../helpers/lotOccupancyDB/getWorkOrderMilestones.js";
|
||||
export const handler = async (request, response) => {
|
||||
const success = deleteRecord("WorkOrderMilestones", request.body.workOrderMilestoneId, request.session);
|
||||
import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js';
|
||||
import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js';
|
||||
export const handler = (request, response) => {
|
||||
const success = deleteRecord('WorkOrderMilestones', request.body.workOrderMilestoneId, request.session);
|
||||
const workOrderMilestones = getWorkOrderMilestones({
|
||||
workOrderId: request.body.workOrderId
|
||||
}, {
|
||||
orderBy: "completion"
|
||||
orderBy: 'completion'
|
||||
});
|
||||
response.json({
|
||||
success,
|
||||
|
|
|
|||
|
|
@ -1,25 +1,29 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { deleteRecord } from "../../helpers/lotOccupancyDB/deleteRecord.js";
|
||||
import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'
|
||||
|
||||
import { getWorkOrderMilestones } from "../../helpers/lotOccupancyDB/getWorkOrderMilestones.js";
|
||||
import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const success = deleteRecord("WorkOrderMilestones", request.body.workOrderMilestoneId, request.session);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const success = deleteRecord(
|
||||
'WorkOrderMilestones',
|
||||
request.body.workOrderMilestoneId,
|
||||
request.session
|
||||
)
|
||||
|
||||
const workOrderMilestones = getWorkOrderMilestones(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
orderBy: "completion"
|
||||
}
|
||||
);
|
||||
const workOrderMilestones = getWorkOrderMilestones(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
orderBy: 'completion'
|
||||
}
|
||||
)
|
||||
|
||||
response.json({
|
||||
success,
|
||||
workOrderMilestones
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success,
|
||||
workOrderMilestones
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { getWorkOrderMilestones } from "../../helpers/lotOccupancyDB/getWorkOrderMilestones.js";
|
||||
export const handler = async (request, response) => {
|
||||
import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js';
|
||||
export const handler = (request, response) => {
|
||||
const workOrderMilestones = getWorkOrderMilestones(request.body, {
|
||||
includeWorkOrders: true,
|
||||
orderBy: "date"
|
||||
orderBy: 'date'
|
||||
});
|
||||
response.json({
|
||||
workOrderMilestones
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { getWorkOrderMilestones } from "../../helpers/lotOccupancyDB/getWorkOrderMilestones.js";
|
||||
import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const workOrderMilestones = getWorkOrderMilestones(request.body, {
|
||||
includeWorkOrders: true,
|
||||
orderBy: "date"
|
||||
});
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const workOrderMilestones = getWorkOrderMilestones(request.body, {
|
||||
includeWorkOrders: true,
|
||||
orderBy: 'date'
|
||||
})
|
||||
|
||||
response.json({
|
||||
workOrderMilestones
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
workOrderMilestones
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { reopenWorkOrder } from "../../helpers/lotOccupancyDB/reopenWorkOrder.js";
|
||||
export const handler = async (request, response) => {
|
||||
import { reopenWorkOrder } from '../../helpers/lotOccupancyDB/reopenWorkOrder.js';
|
||||
export const handler = (request, response) => {
|
||||
const success = reopenWorkOrder(request.body.workOrderId, request.session);
|
||||
response.json({
|
||||
success,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { reopenWorkOrder } from "../../helpers/lotOccupancyDB/reopenWorkOrder.js";
|
||||
import { reopenWorkOrder } from '../../helpers/lotOccupancyDB/reopenWorkOrder.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const success = reopenWorkOrder(request.body.workOrderId, request.session);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const success = reopenWorkOrder(request.body.workOrderId, request.session)
|
||||
|
||||
response.json({
|
||||
success,
|
||||
workOrderId: request.body.workOrderId
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success,
|
||||
workOrderId: request.body.workOrderId
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { reopenWorkOrderMilestone } from "../../helpers/lotOccupancyDB/reopenWorkOrderMilestone.js";
|
||||
import { getWorkOrderMilestones } from "../../helpers/lotOccupancyDB/getWorkOrderMilestones.js";
|
||||
export const handler = async (request, response) => {
|
||||
import { reopenWorkOrderMilestone } from '../../helpers/lotOccupancyDB/reopenWorkOrderMilestone.js';
|
||||
import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js';
|
||||
export const handler = (request, response) => {
|
||||
const success = reopenWorkOrderMilestone(request.body.workOrderMilestoneId, request.session);
|
||||
const workOrderMilestones = getWorkOrderMilestones({
|
||||
workOrderId: request.body.workOrderId
|
||||
}, {
|
||||
orderBy: "completion"
|
||||
orderBy: 'completion'
|
||||
});
|
||||
response.json({
|
||||
success,
|
||||
|
|
|
|||
|
|
@ -1,28 +1,28 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { reopenWorkOrderMilestone } from "../../helpers/lotOccupancyDB/reopenWorkOrderMilestone.js";
|
||||
import { reopenWorkOrderMilestone } from '../../helpers/lotOccupancyDB/reopenWorkOrderMilestone.js'
|
||||
|
||||
import { getWorkOrderMilestones } from "../../helpers/lotOccupancyDB/getWorkOrderMilestones.js";
|
||||
import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const success = reopenWorkOrderMilestone(
|
||||
request.body.workOrderMilestoneId,
|
||||
request.session
|
||||
);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const success = reopenWorkOrderMilestone(
|
||||
request.body.workOrderMilestoneId,
|
||||
request.session
|
||||
)
|
||||
|
||||
const workOrderMilestones = getWorkOrderMilestones(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
orderBy: "completion"
|
||||
}
|
||||
);
|
||||
const workOrderMilestones = getWorkOrderMilestones(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
orderBy: 'completion'
|
||||
}
|
||||
)
|
||||
|
||||
response.json({
|
||||
success,
|
||||
workOrderMilestones
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success,
|
||||
workOrderMilestones
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { getWorkOrders } from "../../helpers/lotOccupancyDB/getWorkOrders.js";
|
||||
export const handler = async (request, response) => {
|
||||
import { getWorkOrders } from '../../helpers/lotOccupancyDB/getWorkOrders.js';
|
||||
export const handler = (request, response) => {
|
||||
const result = getWorkOrders(request.body, {
|
||||
limit: request.body.limit,
|
||||
offset: request.body.offset,
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { getWorkOrders } from "../../helpers/lotOccupancyDB/getWorkOrders.js";
|
||||
import { getWorkOrders } from '../../helpers/lotOccupancyDB/getWorkOrders.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const result = getWorkOrders(request.body, {
|
||||
limit: request.body.limit,
|
||||
offset: request.body.offset,
|
||||
includeLotsAndLotOccupancies: true
|
||||
});
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const result = getWorkOrders(request.body, {
|
||||
limit: request.body.limit,
|
||||
offset: request.body.offset,
|
||||
includeLotsAndLotOccupancies: true
|
||||
})
|
||||
|
||||
response.json({
|
||||
count: result.count,
|
||||
offset: Number.parseInt(request.body.offset, 10),
|
||||
workOrders: result.workOrders
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
count: result.count,
|
||||
offset: Number.parseInt(request.body.offset, 10),
|
||||
workOrders: result.workOrders
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { updateLotStatus } from "../../helpers/lotOccupancyDB/updateLot.js";
|
||||
import { getLots } from "../../helpers/lotOccupancyDB/getLots.js";
|
||||
export const handler = async (request, response) => {
|
||||
import { updateLotStatus } from '../../helpers/lotOccupancyDB/updateLot.js';
|
||||
import { getLots } from '../../helpers/lotOccupancyDB/getLots.js';
|
||||
export const handler = (request, response) => {
|
||||
const success = updateLotStatus(request.body.lotId, request.body.lotStatusId, request.session);
|
||||
const workOrderLots = getLots({
|
||||
workOrderId: request.body.workOrderId
|
||||
|
|
|
|||
|
|
@ -1,26 +1,29 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { updateLotStatus } from "../../helpers/lotOccupancyDB/updateLot.js";
|
||||
import { getLots } from "../../helpers/lotOccupancyDB/getLots.js";
|
||||
import { updateLotStatus } from '../../helpers/lotOccupancyDB/updateLot.js'
|
||||
import { getLots } from '../../helpers/lotOccupancyDB/getLots.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
|
||||
const success = updateLotStatus(request.body.lotId, request.body.lotStatusId, request.session);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const success = updateLotStatus(
|
||||
request.body.lotId,
|
||||
request.body.lotStatusId,
|
||||
request.session
|
||||
)
|
||||
|
||||
const workOrderLots = getLots(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
limit: -1,
|
||||
offset: 0
|
||||
}
|
||||
).lots;
|
||||
const workOrderLots = getLots(
|
||||
{
|
||||
workOrderId: request.body.workOrderId
|
||||
},
|
||||
{
|
||||
limit: -1,
|
||||
offset: 0
|
||||
}
|
||||
).lots
|
||||
|
||||
response.json({
|
||||
success,
|
||||
workOrderLots
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success,
|
||||
workOrderLots
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express';
|
||||
export declare const handler: RequestHandler;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { updateWorkOrder } from "../../helpers/lotOccupancyDB/updateWorkOrder.js";
|
||||
export const handler = async (request, response) => {
|
||||
import { updateWorkOrder } from '../../helpers/lotOccupancyDB/updateWorkOrder.js';
|
||||
export const handler = (request, response) => {
|
||||
const success = updateWorkOrder(request.body, request.session);
|
||||
response.json({
|
||||
success,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import type { RequestHandler } from "express";
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
import { updateWorkOrder } from "../../helpers/lotOccupancyDB/updateWorkOrder.js";
|
||||
import { updateWorkOrder } from '../../helpers/lotOccupancyDB/updateWorkOrder.js'
|
||||
|
||||
export const handler: RequestHandler = async (request, response) => {
|
||||
const success = updateWorkOrder(request.body, request.session);
|
||||
export const handler: RequestHandler = (request, response) => {
|
||||
const success = updateWorkOrder(request.body, request.session)
|
||||
|
||||
response.json({
|
||||
success,
|
||||
workOrderId: request.body.workOrderId
|
||||
});
|
||||
};
|
||||
response.json({
|
||||
success,
|
||||
workOrderId: request.body.workOrderId
|
||||
})
|
||||
}
|
||||
|
||||
export default handler;
|
||||
export default handler
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue