@dnax/core 0.1.17 → 0.1.19

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.
@@ -85,8 +85,8 @@ class useRest {
85
85
  let control = {
86
86
  error: null,
87
87
  value: null,
88
- waring: null
89
- }
88
+ waring: null,
89
+ };
90
90
 
91
91
  /* let issue = err?.issues[0] || {};
92
92
  let msg = `Field : ${issue?.path[0]?.key} - ${issue?.message}`;
@@ -1165,7 +1165,7 @@ class useRest {
1165
1165
  if (Array.isArray(ids)) {
1166
1166
  await this.#tenant.database.db?.collection(collection).deleteMany(
1167
1167
  {
1168
- _id: { $in: formatData(ids) },
1168
+ _id: { $in: formatData(ids.map((d) => d?._id || d)) },
1169
1169
  },
1170
1170
  {
1171
1171
  session: this.#session ? this.#session : undefined,
package/lib/schema.ts CHANGED
@@ -124,7 +124,9 @@ function buildSchema(col: Collection) {
124
124
  if (!f?.validate?.schema) {
125
125
  if (f?.nullable) {
126
126
  propertySchema[f.name] = propertySchema[f.name].optional();
127
- } else {
127
+ }
128
+
129
+ if(f?.required){
128
130
  if(!f?.type?.match(/(random)/))
129
131
  propertySchema[f.name] = propertySchema[f.name].required();
130
132
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "devDependencies": {
package/types/index.ts CHANGED
@@ -96,6 +96,7 @@ export type Field = {
96
96
  multiple?: boolean;
97
97
  items: Array<any>;
98
98
  };
99
+ required?: boolean;
99
100
  nullable?: boolean;
100
101
  defaultValue?: any;
101
102
  unique?: boolean;