@technicity/data-service-generator 0.22.2 → 0.22.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -601,6 +601,7 @@ function getMethodSourceOnHandlerPostOne(x) {
|
|
|
601
601
|
return `on${(0, capitalizeFirstLetter_1.capitalizeFirstLetter)(x.methodName)}(handler:
|
|
602
602
|
(sdk: InstanceType<typeof SDK>, input: { data: ${x.typeDataName} },
|
|
603
603
|
output: Partial<${getTypeReturnName(x.table)}>,
|
|
604
|
+
before: null,
|
|
604
605
|
context: TContext,
|
|
605
606
|
) => Promise<void>
|
|
606
607
|
): void {
|
|
@@ -715,6 +716,7 @@ function getMethodSourceOnHandlerDeleteOne(x, findOnes) {
|
|
|
715
716
|
.map((findOne) => `{ ${findOne.name}: ${findOne.type}${findOne.nullable ? " | null" : ""} }`)
|
|
716
717
|
.join(" | ")}, },
|
|
717
718
|
output: void,
|
|
719
|
+
before: ${getTypeReturnName(x.table)} | null,
|
|
718
720
|
context: TContext,
|
|
719
721
|
) => Promise<void>
|
|
720
722
|
): void {
|
|
@@ -70,7 +70,9 @@ async function resolve(input, dbCall, formatQuery, beginTransaction, dialect, mi
|
|
|
70
70
|
const shouldRunOnHandler = typeof onHandler === "function" &&
|
|
71
71
|
asyncLocalStorage != null &&
|
|
72
72
|
asyncLocalStorage?.getStore()?.isInOnHandler !== true;
|
|
73
|
-
const beforeValue = shouldRunOnHandler &&
|
|
73
|
+
const beforeValue = shouldRunOnHandler &&
|
|
74
|
+
input.passBeforeValueToAfterCallback &&
|
|
75
|
+
input.action !== "create"
|
|
74
76
|
? await _resolve({
|
|
75
77
|
...paramsChanged,
|
|
76
78
|
action: paramsChanged.action === "updateMany" ||
|
|
@@ -103,7 +105,9 @@ async function resolve(input, dbCall, formatQuery, beginTransaction, dialect, mi
|
|
|
103
105
|
const shouldRunOnHandler = typeof onHandler === "function" &&
|
|
104
106
|
asyncLocalStorage != null &&
|
|
105
107
|
asyncLocalStorage?.getStore()?.isInOnHandler !== true;
|
|
106
|
-
const beforeValue = shouldRunOnHandler &&
|
|
108
|
+
const beforeValue = shouldRunOnHandler &&
|
|
109
|
+
input.passBeforeValueToAfterCallback &&
|
|
110
|
+
input.action !== "create"
|
|
107
111
|
? await _resolve({
|
|
108
112
|
...input,
|
|
109
113
|
action: input.action === "updateMany" || input.action === "deleteMany"
|