dobo 1.0.11 → 1.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.
|
@@ -9,12 +9,15 @@ async function findOne (name, filter = {}, opts = {}) {
|
|
|
9
9
|
options.req = opts.req
|
|
10
10
|
options.dataOnly = options.dataOnly ?? true
|
|
11
11
|
let { fields, dataOnly, noHook, noCache, hidden, forceNoHidden } = options
|
|
12
|
-
await this.modelExists(name, true)
|
|
13
|
-
filter.limit = 1
|
|
14
12
|
options.count = false
|
|
15
13
|
options.dataOnly = false
|
|
14
|
+
await this.modelExists(name, true)
|
|
15
|
+
filter.limit = 1
|
|
16
16
|
const { handler, schema, driver } = await resolveMethod.call(this, name, 'record-find', options)
|
|
17
17
|
if (!schema.cacheable) noCache = true
|
|
18
|
+
filter.query = await this.buildQuery({ filter, schema, options }) ?? {}
|
|
19
|
+
if (options.queryHandler) filter.query = await options.queryHandler.call(opts.req ? this.app[opts.req.ns] : this, filter.query, opts.req)
|
|
20
|
+
filter.match = this.buildMatch({ input: filter.match, schema, options }) ?? {}
|
|
18
21
|
if (!noHook) {
|
|
19
22
|
await runHook(`${this.name}:beforeRecordFindOne`, name, filter, options)
|
|
20
23
|
await runHook(`${this.name}.${camelCase(name)}:beforeRecordFindOne`, filter, options)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"field": {
|
|
3
3
|
"id": "ID",
|
|
4
|
+
"code": "Kode",
|
|
4
5
|
"name": "Name",
|
|
5
6
|
"dt": "Date/Time",
|
|
6
7
|
"createdAt": "Created At",
|
|
@@ -50,7 +51,15 @@
|
|
|
50
51
|
"theme": "Theme",
|
|
51
52
|
"token": "Token",
|
|
52
53
|
"field": "Field",
|
|
53
|
-
"agree": "Agreement"
|
|
54
|
+
"agree": "Agreement",
|
|
55
|
+
"method": "Metode",
|
|
56
|
+
"masterId": "Master ID",
|
|
57
|
+
"details": "Details",
|
|
58
|
+
"qty": "QTY",
|
|
59
|
+
"link": "Link",
|
|
60
|
+
"amount": "Amount",
|
|
61
|
+
"cycle": "Cycle",
|
|
62
|
+
"default": "Default"
|
|
54
63
|
},
|
|
55
64
|
"validation": {
|
|
56
65
|
"any.required": "Required",
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"Data Export": "Ekspor Data",
|
|
75
75
|
"field": {
|
|
76
76
|
"id": "ID",
|
|
77
|
+
"code": "Kode",
|
|
77
78
|
"name": "Nama",
|
|
78
79
|
"dt": "Tgl/Jam",
|
|
79
80
|
"createdAt": "Dibuat Pada",
|
|
@@ -123,7 +124,15 @@
|
|
|
123
124
|
"theme": "Tema",
|
|
124
125
|
"token": "Token",
|
|
125
126
|
"field": "Field",
|
|
126
|
-
"agree": "Persetujuan"
|
|
127
|
+
"agree": "Persetujuan",
|
|
128
|
+
"method": "Metode",
|
|
129
|
+
"masterId": "ID Master",
|
|
130
|
+
"details": "Detil",
|
|
131
|
+
"qty": "JML",
|
|
132
|
+
"link": "Tautan",
|
|
133
|
+
"amount": "Nilai",
|
|
134
|
+
"cycle": "Cycle",
|
|
135
|
+
"default": "Default"
|
|
127
136
|
},
|
|
128
137
|
"Validation Error": "Kesalahan Validasi",
|
|
129
138
|
"validation": {
|
package/lib/add-fixtures.js
CHANGED
|
@@ -15,7 +15,8 @@ async function addFixture (name, { spinner } = {}) {
|
|
|
15
15
|
let items = await readConfig(pattern, { ns: schema.ns, ignoreError: true })
|
|
16
16
|
if (isEmpty(items)) items = []
|
|
17
17
|
// override
|
|
18
|
-
const overrides = await readConfig(`${
|
|
18
|
+
const overrides = await readConfig(`${this.app.main.dir.pkg}/dobo/override/${schema.ns}/fixture/${base}.*`, { ns: this.name, ignoreError: true })
|
|
19
|
+
|
|
19
20
|
if (isArray(overrides) && !isEmpty(overrides)) items = overrides
|
|
20
21
|
// extend
|
|
21
22
|
await eachPlugins(async function ({ dir, ns }) {
|