rez_core 2.2.92 → 2.2.94

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,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "2.2.92",
3
+ "version": "2.2.94",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -67,14 +67,29 @@ export class PopulateMetaService {
67
67
 
68
68
  if (!factoryData.length) continue;
69
69
 
70
- const transformedData = factoryData.map(
71
- ({ id, created_date, modified_date, ...rest }) => ({
72
- ...rest,
73
- organization_id,
74
- level_type: 'ORG',
75
- level_id: organization_id,
76
- }),
77
- );
70
+ let transformedData;
71
+
72
+ if (table === 'cr_attribute_master') {
73
+ transformedData = factoryData.map(
74
+ ({ id, created_date, modified_date, ...rest }) => ({
75
+ ...rest,
76
+ organization_id,
77
+ level_type: 'ORG',
78
+ level_id: organization_id,
79
+ is_unique: rest.is_unique == 1 ? true : false,
80
+ required: rest.required == 1 ? true : false,
81
+ }),
82
+ );
83
+ } else {
84
+ transformedData = factoryData.map(
85
+ ({ id, created_date, modified_date, ...rest }) => ({
86
+ ...rest,
87
+ organization_id,
88
+ level_type: 'ORG',
89
+ level_id: organization_id,
90
+ }),
91
+ );
92
+ }
78
93
 
79
94
  await this.dataSource
80
95
  .createQueryBuilder()
@@ -10,16 +10,23 @@ export class EmailService {
10
10
  private readonly datasource: DataSource,
11
11
  ) {}
12
12
 
13
- async sendEmail(email, name: string, otp: string) {
13
+ async sendEmail(email: string, subject: string, context?: any) {
14
+ const template = await this.datasource
15
+ .getRepository('cr_wf_comm_template')
16
+ .findOne({ where: { code: 'OTP_TEMPLATE' } });
17
+
18
+ if (!template) {
19
+ return;
20
+ }
21
+
22
+ const compiled = Handlebars.compile(template.rich_text || '');
23
+ const htmlContent = compiled(context);
24
+
14
25
  this.mailerService
15
26
  .sendMail({
16
27
  to: email,
17
- subject: 'Testing Nest MailerModule ✔', // Subject line
18
- template: 'sample', // `.hbs` extension is appended automatically
19
- context: {
20
- name,
21
- otp,
22
- },
28
+ subject: subject,
29
+ html: htmlContent,
23
30
  })
24
31
  .then(() => {})
25
32
  .catch(() => {});
@@ -1,5 +0,0 @@
1
- {
2
- "recommendations": [
3
- "dbaeumer.vscode-eslint"
4
- ]
5
- }