rez_core 3.1.181 → 3.1.183

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,3 +1,4 @@
1
+ import { app } from 'firebase-admin';
1
2
  import { BadGatewayException, Inject, Injectable } from '@nestjs/common';
2
3
  import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
3
4
  import { StageGroupRepository } from '../repository/stage-group.repository';
@@ -10,6 +11,8 @@ import { InjectRepository } from '@nestjs/typeorm';
10
11
  import { StageMovementData } from '../entity/stage-movement-data.entity';
11
12
  import * as moment from 'moment';
12
13
  import { MediaDataService } from 'src/module/meta/service/media-data.service';
14
+ import axios from 'axios';
15
+ import { ConfigService } from '@nestjs/config';
13
16
 
14
17
  @Injectable()
15
18
  export class StageGroupService extends EntityServiceImpl {
@@ -23,6 +26,7 @@ export class StageGroupService extends EntityServiceImpl {
23
26
  @InjectRepository(StageMovementData)
24
27
  private readonly stageMovementRepo: Repository<StageMovementData>,
25
28
  private readonly mediaDataService: MediaDataService,
29
+ private readonly configService: ConfigService,
26
30
  ) {
27
31
  super();
28
32
  }
@@ -206,13 +210,39 @@ export class StageGroupService extends EntityServiceImpl {
206
210
  userId: number,
207
211
  loggedInUser: UserData,
208
212
  ): Promise<any> {
209
- const user = await this.dataSource.query(
210
- `SELECT eth_user_profile.name AS created_by_name,
211
- eth_user_profile.profile_image AS profile_image
212
- FROM eth_user_profile
213
- WHERE eth_user_profile.id = ?;`,
214
- [userId],
215
- );
213
+ // const user = await this.dataSource.query(
214
+ // `SELECT eth_user_profile.name AS created_by_name,
215
+ // eth_user_profile.profile_image AS profile_image
216
+ // FROM eth_user_profile
217
+ // WHERE eth_user_profile.id = ?;`,
218
+ // [userId],
219
+ // );
220
+
221
+ let user: any = [];
222
+
223
+ try {
224
+ const baseUrl = this.configService.get<string>('REDIRECT_BE_URL');
225
+
226
+ // Prepare the query string
227
+ const queryParams = new URLSearchParams({
228
+ loggedInUser: JSON.stringify(loggedInUser),
229
+ }).toString();
230
+
231
+ // Make the GET request with query parameters
232
+ const response = await axios.get(
233
+ `${baseUrl}/entity/public/getById/${userId}?entity_type=UPR&${queryParams}`,
234
+ {
235
+ headers: {
236
+ 'Content-Type': 'application/json',
237
+ },
238
+ },
239
+ );
240
+
241
+ console.log('✅ Internal Entity API response:', response.data);
242
+ user = [response.data];
243
+ } catch (error) {
244
+ console.error('⚠️ Internal Entity API call failed:', error.message);
245
+ }
216
246
 
217
247
  if (user.length === 0) return null;
218
248