sumba 1.0.25 → 1.0.26

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.
@@ -1,4 +1,5 @@
1
1
  async function afterRecordCreate (body, options = {}, rec) {
2
+ if (!options.req) return
2
3
  if (!this.app.waibu) return
3
4
  const { sendMail } = this.app.waibu
4
5
  const { data } = rec
@@ -1,9 +1,10 @@
1
1
  async function afterRecordCreate (body, options = {}, rec) {
2
+ if (!options.req) return
2
3
  if (!this.app.waibu) return
3
4
  const { sendMail } = this.app.waibu
4
5
  const { data } = rec
5
6
  const to = `${data.firstName} ${data.lastName} <${data.email}>`
6
- const subject = options.req.t('newUserSignup')
7
+ const subject = this.print.write('newUserSignup')
7
8
  await sendMail(
8
9
  'sumba.template:/_mail/user-signup-success.html',
9
10
  { to, subject, data, options }
@@ -1,4 +1,5 @@
1
1
  async function afterRecordUpdate (id, body, options = {}, rec) {
2
+ if (!options.req) return
2
3
  if (!this.app.waibu) return
3
4
  const { data, oldData } = rec
4
5
  const { sendMail } = this.app.waibu
@@ -9,7 +9,7 @@ async function passwordRule (req) {
9
9
  .min(8)
10
10
  .max(100)
11
11
  .required()
12
- const cfg = req.site.setting.sumba.userPassword
12
+ const cfg = req ? req.site.setting.sumba.userPassword : this.config.siteSetting
13
13
  if (cfg.minUppercase) password = password.minOfUppercase(cfg.minUppercase)
14
14
  if (cfg.minLowercase) password = password.minOfLowercase(cfg.minLowercase)
15
15
  if (cfg.minSpecialChar) password = password.minOfSpecialCharacters(cfg.minSpecialChar)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sumba",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "description": "Bajo Framework's Biz Suite",
5
5
  "main": "index.js",
6
6
  "scripts": {