adminforth 1.0.38 → 1.0.39
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.
- package/dist/index.js +5 -2
- package/index.ts +5 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -519,11 +519,14 @@ class AdminForth {
|
|
|
519
519
|
}
|
|
520
520
|
const resource = this.config.resources.find((res) => res.resourceId == resourceId);
|
|
521
521
|
if (!resource) {
|
|
522
|
-
return { error: `Resource ${resourceId} not found` };
|
|
522
|
+
return { error: `Resource '${resourceId}' not found` };
|
|
523
523
|
}
|
|
524
524
|
const columnConfig = resource.columns.find((col) => col.name == column);
|
|
525
|
+
if (!columnConfig) {
|
|
526
|
+
return { error: `Column "${column}' not found in resource with resourceId '${resourceId}'` };
|
|
527
|
+
}
|
|
525
528
|
if (!columnConfig.foreignResource) {
|
|
526
|
-
return { error: `Column ${column} in resource ${resourceId} is not a foreign key` };
|
|
529
|
+
return { error: `Column '${column}' in resource '${resourceId}' is not a foreign key` };
|
|
527
530
|
}
|
|
528
531
|
const targetResourceId = columnConfig.foreignResource.resourceId;
|
|
529
532
|
const targetResource = this.config.resources.find((res) => res.resourceId == targetResourceId);
|
package/index.ts
CHANGED
|
@@ -588,11 +588,14 @@ class AdminForth {
|
|
|
588
588
|
}
|
|
589
589
|
const resource = this.config.resources.find((res) => res.resourceId == resourceId);
|
|
590
590
|
if (!resource) {
|
|
591
|
-
return { error: `Resource ${resourceId} not found` };
|
|
591
|
+
return { error: `Resource '${resourceId}' not found` };
|
|
592
592
|
}
|
|
593
593
|
const columnConfig = resource.columns.find((col) => col.name == column);
|
|
594
|
+
if (!columnConfig) {
|
|
595
|
+
return { error: `Column "${column}' not found in resource with resourceId '${resourceId}'` };
|
|
596
|
+
}
|
|
594
597
|
if (!columnConfig.foreignResource) {
|
|
595
|
-
return { error: `Column ${column} in resource ${resourceId} is not a foreign key` };
|
|
598
|
+
return { error: `Column '${column}' in resource '${resourceId}' is not a foreign key` };
|
|
596
599
|
}
|
|
597
600
|
const targetResourceId = columnConfig.foreignResource.resourceId;
|
|
598
601
|
const targetResource = this.config.resources.find((res) => res.resourceId == targetResourceId);
|