tango-api-schema 1.0.1 → 1.0.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.
- package/index.js +4 -1
- package/package.json +2 -2
- package/schema/client.model.js +13 -4
package/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import brandModel from './schema/brand.model.js'
|
|
2
2
|
import storeModel from './schema/stores.model.js'
|
|
3
3
|
import cameraModel from './schema/camera.model.js'
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
import client from './schema/client.model.js'
|
|
6
|
+
|
|
7
|
+
export default client
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-api-schema",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "tangoEye model schema",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
-
"start": "
|
|
9
|
+
"start": "node index.js"
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
package/schema/client.model.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import mongoose
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
2
|
import uniqueValidator from 'mongoose-unique-validator';
|
|
3
3
|
|
|
4
|
-
const clientSchema=new Schema( {
|
|
4
|
+
const clientSchema=new mongoose.Schema( {
|
|
5
5
|
brandName: {
|
|
6
6
|
type: String,
|
|
7
7
|
trim: true,
|
|
@@ -17,7 +17,7 @@ const clientSchema=new Schema( {
|
|
|
17
17
|
},
|
|
18
18
|
userDetail: {
|
|
19
19
|
userId: {
|
|
20
|
-
type: Schema.Types.ObjectId,
|
|
20
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
21
21
|
ref: 'User',
|
|
22
22
|
},
|
|
23
23
|
firstName: {
|
|
@@ -179,5 +179,14 @@ const clientSchema=new Schema( {
|
|
|
179
179
|
versionKey: false,
|
|
180
180
|
timestamps: true,
|
|
181
181
|
} );
|
|
182
|
+
|
|
182
183
|
clientSchema.plugin( uniqueValidator );
|
|
183
|
-
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
// const Client = model('Client', clientSchema);
|
|
187
|
+
|
|
188
|
+
// export default Client;
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
export default mongoose.model( 'Client', clientSchema );
|