yaml-admin-api 0.0.12 → 0.0.13
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/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yaml-admin-api",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"description": "YAML Admin API package",
|
|
5
6
|
"type": "commonjs",
|
|
6
7
|
"main": "src/index.js",
|
|
7
8
|
"files": [
|
|
8
9
|
"src"
|
|
9
10
|
],
|
|
10
|
-
"license": "MIT",
|
|
11
11
|
"scripts": {
|
|
12
12
|
"pub": "npm publish -w yaml-admin-api --access public"
|
|
13
13
|
},
|
|
@@ -131,9 +131,8 @@ const generateCrud = async ({ app, db, entity_name, yml_entity, yml, options })
|
|
|
131
131
|
let { image, video, src } = media
|
|
132
132
|
let url = image || src
|
|
133
133
|
media.image_preview = await mediaKeyToFullUrl(url, private)
|
|
134
|
-
if (video)
|
|
134
|
+
if (video)
|
|
135
135
|
media.video_preview = await mediaKeyToFullUrl(video, private)
|
|
136
|
-
}
|
|
137
136
|
}
|
|
138
137
|
return media
|
|
139
138
|
}
|
|
@@ -156,7 +155,7 @@ const generateCrud = async ({ app, db, entity_name, yml_entity, yml, options })
|
|
|
156
155
|
yml_entity.fields?.forEach(field => {
|
|
157
156
|
const q = req.query[field.name];
|
|
158
157
|
if (q) {
|
|
159
|
-
const search = yml_entity.crud?.
|
|
158
|
+
const search = yml_entity.crud?.search?.find(m => m.name == field.name)
|
|
160
159
|
if (Array.isArray(q)) {
|
|
161
160
|
f[field.name] = { $in: q.map(v => parseValueByType(v, field)) };
|
|
162
161
|
} else {
|
package/src/upload/s3Upload.js
CHANGED