Skip to content

Commit

Permalink
1605 upgrade to node 20, fixed one test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
horatiorosa committed Dec 9, 2024
1 parent e2303fa commit 911e19c
Show file tree
Hide file tree
Showing 4 changed files with 1,876 additions and 2,339 deletions.
2 changes: 1 addition & 1 deletion server/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.19.0
20
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "",
"license": "MIT",
"engines": {
"node": "18"
"node": "20"
},
"scripts": {
"build": "rimraf dist && tsc -p tsconfig.build.json",
Expand Down
21 changes: 16 additions & 5 deletions server/src/disposition/defaultValue.disposition.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,23 @@ import { PipeTransform, Injectable, ArgumentMetadata } from "@nestjs/common";
@Injectable()
export class defaultValueDispositionPipe implements PipeTransform<any, any> {
transform(value: any, { type }: ArgumentMetadata) {
const { data } = value;
if (type === "body") {
if (!data.attributes["dcp-nameofpersoncompletingthisform"]) {
data.attributes["dcp-nameofpersoncompletingthisform"] =
"ZAP LUP Portal";
const data = value?.data;

if (!data) {
console.debug('Value is empty or does not contain "data". Skipping processing.');
return value;
}

try {
if (type === "body") {
if (!data.attributes["dcp-nameofpersoncompletingthisform"]) {
data.attributes["dcp-nameofpersoncompletingthisform"] =
"ZAP LUP Portal";
}
}
} catch (e) {
console.debug(`Error setting default value for disposition: ${e.message}`);
return value = null;
}
return value;
}
Expand Down
Loading

0 comments on commit 911e19c

Please sign in to comment.