rez_core 5.0.280 → 5.0.283
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/.idea/250218_ether_core.iml +12 -0
- package/.idea/codeStyles/Project.xml +59 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/dist/module/enterprise/service/organization.service.d.ts +1 -1
- package/dist/module/enterprise/service/organization.service.js +13 -6
- package/dist/module/enterprise/service/organization.service.js.map +1 -1
- package/dist/module/filter/service/filter.service.js +2 -2
- package/dist/module/filter/service/filter.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/enterprise/service/organization.service.ts +45 -11
- package/src/module/filter/service/filter.service.ts +7 -2
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
1
|
+
import { Inject, Injectable,BadRequestException } from '@nestjs/common';
|
|
2
2
|
import { InjectRepository } from '@nestjs/typeorm';
|
|
3
3
|
import { ClockIDGenService } from 'src/utils/service/clockIDGenUtil.service';
|
|
4
4
|
import { EntityManager, IsNull, Repository } from 'typeorm';
|
|
@@ -111,19 +111,53 @@ export class OrganizationService {
|
|
|
111
111
|
return await this.organizationRepository.find({ where: { id } });
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
async update(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
): Promise<OrganizationData | null> {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
114
|
+
// async update(
|
|
115
|
+
// id: number,
|
|
116
|
+
// organizationDto: Partial<OrganizationData>,
|
|
117
|
+
// // manager?: EntityManager,
|
|
118
|
+
// ): Promise<OrganizationData | null> {
|
|
119
|
+
// // const repo = manager
|
|
120
|
+
// // ? manager.getRepository(OrganizationData)
|
|
121
|
+
// // : this.organizationRepository;
|
|
122
|
+
|
|
123
|
+
// const repo = this.organizationRepository;
|
|
124
|
+
|
|
125
|
+
// await repo.update(id, organizationDto);
|
|
126
|
+
// return await repo.findOne({ where: { id } });
|
|
127
|
+
// }
|
|
128
|
+
|
|
129
|
+
async update(
|
|
130
|
+
organizationDto: Partial<OrganizationData>,
|
|
131
|
+
userData: any,
|
|
132
|
+
): Promise<OrganizationData | null> {
|
|
133
|
+
|
|
134
|
+
const orgId =
|
|
135
|
+
typeof organizationDto.id === 'number'
|
|
136
|
+
? organizationDto.id
|
|
137
|
+
: parseInt(String(organizationDto.id).trim(), 10);
|
|
138
|
+
|
|
139
|
+
if (!Number.isInteger(orgId)) {
|
|
140
|
+
throw new BadRequestException('Invalid organization id');
|
|
141
|
+
}
|
|
122
142
|
|
|
123
|
-
|
|
124
|
-
|
|
143
|
+
const {
|
|
144
|
+
id: _ignoreId,
|
|
145
|
+
sessionToken,
|
|
146
|
+
appcode,
|
|
147
|
+
email_id,
|
|
148
|
+
level_id,
|
|
149
|
+
level_type,
|
|
150
|
+
...dbData
|
|
151
|
+
} = organizationDto as any;
|
|
152
|
+
|
|
153
|
+
if (!dbData || Object.keys(dbData).length === 0) {
|
|
154
|
+
throw new BadRequestException('No valid fields to update');
|
|
125
155
|
}
|
|
126
156
|
|
|
157
|
+
await this.organizationRepository.update(orgId, dbData);
|
|
158
|
+
return this.organizationRepository.findOne({ where: { id: orgId } });
|
|
159
|
+
}
|
|
160
|
+
|
|
127
161
|
async remove(id: number, manager?: EntityManager): Promise<void> {
|
|
128
162
|
const repo = manager
|
|
129
163
|
? manager.getRepository(OrganizationData)
|
|
@@ -87,9 +87,14 @@ export class FilterService {
|
|
|
87
87
|
if (Array.isArray(val)) {
|
|
88
88
|
// Create ($1,$2,$3)
|
|
89
89
|
const placeholders = val.map(() => `$${paramIndex++}`).join(', ');
|
|
90
|
+
// parsedQuery = parsedQuery
|
|
91
|
+
// .replace(new RegExp(`:...${key}`, 'g'), `${placeholders}`)
|
|
92
|
+
// .replace(new RegExp(`:${key}`, 'g'), `${placeholders}`);
|
|
93
|
+
|
|
90
94
|
parsedQuery = parsedQuery
|
|
91
|
-
.replace(new RegExp(`:...${key}`, 'g'),
|
|
92
|
-
.replace(new RegExp(`:${key}`, 'g'),
|
|
95
|
+
.replace(new RegExp(`:...${key}`, 'g'), placeholders)
|
|
96
|
+
.replace(new RegExp(`:${key}`, 'g'), placeholders);
|
|
97
|
+
|
|
93
98
|
values.push(...val.map((v) => String(v)));
|
|
94
99
|
} else {
|
|
95
100
|
// Create $1
|