linting
parent
f96d975aa0
commit
19a7c81766
|
|
@ -61,9 +61,9 @@ Open a command line, and navigate to the folder where the application will resid
|
||||||
|
|
||||||
## Step 5: Create a `config.js` file
|
## Step 5: Create a `config.js` file
|
||||||
|
|
||||||
It is recommended to copy the `config.testing.js` file to get started.
|
It is recommended to copy the `testing.config.js` file to get started.
|
||||||
|
|
||||||
> cp data/config.testing.js data/config.js
|
> cp data/testing.config.js data/config.js
|
||||||
|
|
||||||
See the [config.js documentation](configJs.md) for help customizing
|
See the [config.js documentation](configJs.md) for help customizing
|
||||||
your configuration.
|
your configuration.
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
|
import getBurialSiteDirectionsOfArrival, { defaultDirectionsOfArrival } from '../../database/getBurialSiteDirectionsOfArrival.js';
|
||||||
import getCemeteries from '../../database/getCemeteries.js';
|
import getCemeteries from '../../database/getCemeteries.js';
|
||||||
import getContract from '../../database/getContract.js';
|
import getContract from '../../database/getContract.js';
|
||||||
import getFuneralHomes from '../../database/getFuneralHomes.js';
|
import getFuneralHomes from '../../database/getFuneralHomes.js';
|
||||||
import { getConfigProperty } from '../../helpers/config.helpers.js';
|
import { getConfigProperty } from '../../helpers/config.helpers.js';
|
||||||
import { getBurialSiteStatuses, getBurialSiteTypes, getCommittalTypes, getContractTypePrintsById, getContractTypes, getIntermentContainerTypes, getWorkOrderTypes } from '../../helpers/functions.cache.js';
|
import { getBurialSiteStatuses, getBurialSiteTypes, getCommittalTypes, getContractTypePrintsById, getContractTypes, getIntermentContainerTypes, getWorkOrderTypes } from '../../helpers/functions.cache.js';
|
||||||
import getBurialSiteDirectionsOfArrival, { defaultDirectionsOfArrival } from '../../database/getBurialSiteDirectionsOfArrival.js';
|
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const contract = await getContract(request.params.contractId);
|
const contract = await getContract(request.params.contractId);
|
||||||
if (contract === undefined) {
|
if (contract === undefined) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
|
import getBurialSiteDirectionsOfArrival, {
|
||||||
|
defaultDirectionsOfArrival
|
||||||
|
} from '../../database/getBurialSiteDirectionsOfArrival.js'
|
||||||
import getCemeteries from '../../database/getCemeteries.js'
|
import getCemeteries from '../../database/getCemeteries.js'
|
||||||
import getContract from '../../database/getContract.js'
|
import getContract from '../../database/getContract.js'
|
||||||
import getFuneralHomes from '../../database/getFuneralHomes.js'
|
import getFuneralHomes from '../../database/getFuneralHomes.js'
|
||||||
|
|
@ -13,9 +16,6 @@ import {
|
||||||
getIntermentContainerTypes,
|
getIntermentContainerTypes,
|
||||||
getWorkOrderTypes
|
getWorkOrderTypes
|
||||||
} from '../../helpers/functions.cache.js'
|
} from '../../helpers/functions.cache.js'
|
||||||
import getBurialSiteDirectionsOfArrival, {
|
|
||||||
defaultDirectionsOfArrival
|
|
||||||
} from '../../database/getBurialSiteDirectionsOfArrival.js'
|
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,9 @@ export function getCemeteryIdByKey(cemeteryKeyToSearch, user) {
|
||||||
if (cemeteryCache.has(cemeteryKey)) {
|
if (cemeteryCache.has(cemeteryKey)) {
|
||||||
return cemeteryCache.get(cemeteryKey);
|
return cemeteryCache.get(cemeteryKey);
|
||||||
}
|
}
|
||||||
|
console.log(`Cemetery cache miss: ${cemeteryKey}`);
|
||||||
const cemetery = getCemeteryByKey(cemeteryKey);
|
const cemetery = getCemeteryByKey(cemeteryKey);
|
||||||
|
console.log(`Cemetery found: ${cemeteryKey}`);
|
||||||
if (cemetery === undefined) {
|
if (cemetery === undefined) {
|
||||||
console.log(`Creating cemetery: ${cemeteryKey}`);
|
console.log(`Creating cemetery: ${cemeteryKey}`);
|
||||||
let addForm = cemeteryKeyToCemetery[cemeteryKey];
|
let addForm = cemeteryKeyToCemetery[cemeteryKey];
|
||||||
|
|
@ -234,5 +236,8 @@ export function getCemeteryIdByKey(cemeteryKeyToSearch, user) {
|
||||||
const cemeteryId = addCemetery(addForm, user);
|
const cemeteryId = addCemetery(addForm, user);
|
||||||
cemeteryCache.set(cemeteryKey, cemeteryId);
|
cemeteryCache.set(cemeteryKey, cemeteryId);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
cemeteryCache.set(cemeteryKey, cemetery.cemeteryId);
|
||||||
|
}
|
||||||
return cemeteryCache.get(cemeteryKey);
|
return cemeteryCache.get(cemeteryKey);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -281,8 +281,12 @@ export function getCemeteryIdByKey(
|
||||||
return cemeteryCache.get(cemeteryKey) as number
|
return cemeteryCache.get(cemeteryKey) as number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(`Cemetery cache miss: ${cemeteryKey}`)
|
||||||
|
|
||||||
const cemetery = getCemeteryByKey(cemeteryKey)
|
const cemetery = getCemeteryByKey(cemeteryKey)
|
||||||
|
|
||||||
|
console.log(`Cemetery found: ${cemeteryKey}`)
|
||||||
|
|
||||||
if (cemetery === undefined) {
|
if (cemetery === undefined) {
|
||||||
console.log(`Creating cemetery: ${cemeteryKey}`)
|
console.log(`Creating cemetery: ${cemeteryKey}`)
|
||||||
|
|
||||||
|
|
@ -312,6 +316,8 @@ export function getCemeteryIdByKey(
|
||||||
const cemeteryId = addCemetery(addForm, user)
|
const cemeteryId = addCemetery(addForm, user)
|
||||||
|
|
||||||
cemeteryCache.set(cemeteryKey, cemeteryId)
|
cemeteryCache.set(cemeteryKey, cemeteryId)
|
||||||
|
} else {
|
||||||
|
cemeteryCache.set(cemeteryKey, cemetery.cemeteryId as number)
|
||||||
}
|
}
|
||||||
|
|
||||||
return cemeteryCache.get(cemeteryKey) as number
|
return cemeteryCache.get(cemeteryKey) as number
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue