remult 3.0.3 → 3.0.4
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/esm/src/validators.js
CHANGED
|
@@ -67,7 +67,7 @@ export class Validators {
|
|
|
67
67
|
*/
|
|
68
68
|
static enum = createValueValidatorWithArgs((value, enumObj) => Object.values(enumObj).includes(value), (enumObj) => `Value must be one of ${getEnumValues(enumObj).join(', ')}`);
|
|
69
69
|
/**
|
|
70
|
-
* Validator to check if a related value exists in the database.
|
|
70
|
+
* Validator to check if a related value exists in the database. By side-effect it loads relation data so it is directly available in [lifecycle hooks](https://remult.dev/docs/lifecycle-hooks)
|
|
71
71
|
*/
|
|
72
72
|
static relationExists = createValidator(async (_, e) => {
|
|
73
73
|
if (e.valueIsNull())
|
package/package.json
CHANGED
package/src/validators.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export declare class Validators {
|
|
|
48
48
|
defaultMessage: ValueValidationMessage<unknown>;
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
51
|
-
* Validator to check if a related value exists in the database.
|
|
51
|
+
* Validator to check if a related value exists in the database. By side-effect it loads relation data so it is directly available in [lifecycle hooks](https://remult.dev/docs/lifecycle-hooks)
|
|
52
52
|
*/
|
|
53
53
|
static relationExists: Validator<unknown>;
|
|
54
54
|
/**
|
package/src/validators.js
CHANGED
|
@@ -103,7 +103,7 @@ var Validators = /** @class */ (function () {
|
|
|
103
103
|
return "Value must be one of ".concat(getEnumValues(enumObj).join(', '));
|
|
104
104
|
});
|
|
105
105
|
/**
|
|
106
|
-
* Validator to check if a related value exists in the database.
|
|
106
|
+
* Validator to check if a related value exists in the database. By side-effect it loads relation data so it is directly available in [lifecycle hooks](https://remult.dev/docs/lifecycle-hooks)
|
|
107
107
|
*/
|
|
108
108
|
Validators.relationExists = createValidator(function (_, e) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
109
109
|
var _b;
|