sumba 2.19.0 → 2.19.2
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/extend/bajoTemplate/partial/your-stuff/profile/edit.html +1 -1
- package/extend/dobo/feature/person-in-charge.js +2 -1
- package/extend/waibuDb/schema/user.js +0 -3
- package/extend/waibuMpa/extend/waibuAdmin/route/reset-user-password.js +1 -1
- package/extend/waibuMpa/route/your-stuff/profile/edit.js +11 -4
- package/package.json +1 -1
- package/wiki/CHANGES.md +10 -0
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<c:form-input name="city" label-floating col="8-lg 7-md"/>
|
|
18
18
|
<c:form-input name="zipCode" label-floating col="4-lg 5-md"/>
|
|
19
19
|
<c:form-input name="provinceState" label-floating col="6-lg"/>
|
|
20
|
-
<c:form-select-
|
|
20
|
+
<c:form-select-ext name="country" label-floating col="6-lg"/>
|
|
21
21
|
<c:form-input name="phone" label-floating col="6-lg"/>
|
|
22
22
|
<c:form-input name="website" label-floating col="6-lg"/>
|
|
23
23
|
</c:fieldset>
|
|
@@ -21,7 +21,7 @@ const resetUserPassword = {
|
|
|
21
21
|
} catch (err) {
|
|
22
22
|
throw this.error('validationError', { details: err.details, values: err.values, ns: this.ns, statusCode: 422, code: 'DB_VALIDATION' })
|
|
23
23
|
}
|
|
24
|
-
const rec = await model.findOneRecord({ query: { username: req.body.username } })
|
|
24
|
+
const rec = await model.findOneRecord({ query: { username: req.body.username } }, { req })
|
|
25
25
|
if (!rec) throw this.error('unknownUser', { details: [{ field: 'username', error: 'unknownUser' }], statusCode: 400 })
|
|
26
26
|
await model.updateRecord(rec.id, { password: req.body.password }, { req, reply })
|
|
27
27
|
form.password = ''
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
const fields = ['email', 'firstName', 'lastName', 'address1', 'address2', 'city', 'zipCode', 'provinceState', 'country', 'phone', 'website']
|
|
2
|
+
const model = 'SumbaUser'
|
|
2
3
|
|
|
3
4
|
const profile = {
|
|
4
5
|
method: ['GET', 'POST'],
|
|
5
6
|
handler: async function (req, reply) {
|
|
6
7
|
const { defaultsDeep } = this.app.lib.aneka
|
|
7
|
-
// const { attachmentCopyUploaded } = this.app.dobo
|
|
8
8
|
const { updateRecord, getRecord } = this.app.waibuDb
|
|
9
|
+
const { getSchemaExt } = this.app.waibuDb
|
|
9
10
|
const { omit, pick } = this.app.lib._
|
|
10
11
|
const { hash } = this.app.bajoExtra
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
const options = { forceNoHidden: ['token'], noHook: true, noCache: true, formatValue: true, retainOriginalValue: true }
|
|
14
|
+
const mdl = this.app.dobo.getModel(model)
|
|
15
|
+
|
|
16
|
+
const { schema } = await getSchemaExt(model, 'edit', { ...options, args: [{ req, model: mdl }] })
|
|
17
|
+
|
|
18
|
+
const resp = await getRecord({ model, req, id: req.user.id, options })
|
|
12
19
|
let form = defaultsDeep(req.body, omit(resp.data, ['password', 'salt']))
|
|
13
20
|
form.token = await hash(form.token)
|
|
14
21
|
let error
|
|
@@ -16,7 +23,7 @@ const profile = {
|
|
|
16
23
|
try {
|
|
17
24
|
const body = pick(form, fields)
|
|
18
25
|
const options = { noFlash: true, hidden: [], setField: 'profile', setFile: 'main.png', partial: true, fields }
|
|
19
|
-
const resp = await updateRecord({ req, reply, model
|
|
26
|
+
const resp = await updateRecord({ req, reply, model, id: req.user.id, body, options })
|
|
20
27
|
form = resp.data
|
|
21
28
|
req.flash('notify', req.t('profileUpdated'))
|
|
22
29
|
return reply.redirectTo('sumba:/your-stuff/profile')
|
|
@@ -24,7 +31,7 @@ const profile = {
|
|
|
24
31
|
error = err
|
|
25
32
|
}
|
|
26
33
|
}
|
|
27
|
-
return await reply.view('sumba.template:/your-stuff/profile/edit.html', { form, error })
|
|
34
|
+
return await reply.view('sumba.template:/your-stuff/profile/edit.html', { form, error, schema })
|
|
28
35
|
}
|
|
29
36
|
}
|
|
30
37
|
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-04-18
|
|
4
|
+
|
|
5
|
+
- [2.19.2] Bug fix in ```sumba:personInCharge``` feature: add email rules
|
|
6
|
+
- [2.19.2] Bug fix in ```SumbaUser``` schema
|
|
7
|
+
- [2.19.2] Bug fix in ```reset-user-password``` route
|
|
8
|
+
|
|
9
|
+
## 2026-04-17
|
|
10
|
+
|
|
11
|
+
- [2.19.1] Bug fix in profile edit's route
|
|
12
|
+
|
|
3
13
|
## 2026-04-16
|
|
4
14
|
|
|
5
15
|
- [2.19.0] Add cache clearing if a site is updated/removed
|