waibu-db 1.1.7 → 1.1.8
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,12 +1,10 @@
|
|
|
1
1
|
import prepCrud from '../../../lib/prep-crud.js'
|
|
2
2
|
|
|
3
3
|
async function get ({ model, req, reply, id, options = {} }) {
|
|
4
|
-
const { recordFindOne
|
|
5
|
-
const { name, filter, opts
|
|
4
|
+
const { recordFindOne } = this.app.dobo
|
|
5
|
+
const { name, filter, opts } = prepCrud.call(this, { model, req, reply, id, options, args: ['model', 'id'] })
|
|
6
6
|
filter.query = { $and: [filter.query ?? {}, { id: id ?? req.params.id }] }
|
|
7
|
-
opts.dataOnly = true
|
|
8
7
|
const ret = await recordFindOne(name, filter, opts)
|
|
9
|
-
if (attachment) ret.data._attachment = await attachmentFind(name, ret.id, { stats, mimeType })
|
|
10
8
|
return ret
|
|
11
9
|
}
|
|
12
10
|
|