Merge branch 'sprint1' of http://git.wdipl.com/Mayank.Mishra/MinglarBackendNestJS into paritosh-main1
This commit is contained in:
@@ -291,26 +291,26 @@ export class MinglarService {
|
||||
// Process each activity
|
||||
for (const activity of hostActivities) {
|
||||
|
||||
/** --------------------------
|
||||
* 1️⃣ Process Activity Media
|
||||
* -------------------------- */
|
||||
if (activity.ActivitiesMedia?.length) {
|
||||
for (const media of activity.ActivitiesMedia) {
|
||||
/** 1️⃣ Process Activity Media */
|
||||
const processedMedia = [];
|
||||
|
||||
if (!media.mediaFileName) continue;
|
||||
for (const media of activity.ActivitiesMedia || []) {
|
||||
|
||||
// Extract S3 key if URL or keep raw key
|
||||
const key = media.mediaFileName.startsWith("http")
|
||||
? media.mediaFileName.split(".com/")[1]
|
||||
: media.mediaFileName;
|
||||
const key = media.mediaFileName?.startsWith("http")
|
||||
? media.mediaFileName.split(".com/")[1]
|
||||
: media.mediaFileName;
|
||||
|
||||
media.mediaFileName = await getPresignedUrl(bucket, key);
|
||||
}
|
||||
const presignedUrl = key ? await getPresignedUrl(bucket, key) : null;
|
||||
|
||||
processedMedia.push({
|
||||
...media,
|
||||
presignedUrl,
|
||||
});
|
||||
}
|
||||
|
||||
/** --------------------------
|
||||
* 2️⃣ Process AM Profile Image
|
||||
* -------------------------- */
|
||||
activity.ActivitiesMedia = processedMedia;
|
||||
|
||||
/** 2️⃣ Process AM Profile Image */
|
||||
const am = activity.ActivityAmDetails?.[0]?.accountManager;
|
||||
|
||||
if (am?.profileImage) {
|
||||
@@ -318,10 +318,16 @@ export class MinglarService {
|
||||
? am.profileImage.split(".com/")[1]
|
||||
: am.profileImage;
|
||||
|
||||
am.profileImage = await getPresignedUrl(bucket, key);
|
||||
const presignedUrl = await getPresignedUrl(bucket, key);
|
||||
|
||||
activity.ActivityAmDetails[0].accountManager = {
|
||||
...am,
|
||||
profileImage: presignedUrl,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return hostActivities;
|
||||
}
|
||||
|
||||
@@ -1577,6 +1583,25 @@ export class MinglarService {
|
||||
locationLat: true,
|
||||
locationLong: true,
|
||||
locationName: true,
|
||||
pinCode: true,
|
||||
country: {
|
||||
select: {
|
||||
id: true,
|
||||
countryName: true
|
||||
}
|
||||
},
|
||||
cities: {
|
||||
select: {
|
||||
id: true,
|
||||
cityName: true,
|
||||
}
|
||||
},
|
||||
states: {
|
||||
select: {
|
||||
id: true,
|
||||
stateName: true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
userDocuments: {
|
||||
@@ -1645,9 +1670,9 @@ export class MinglarService {
|
||||
isActive: true
|
||||
},
|
||||
data: {
|
||||
activityInternalStatus: ACTIVITY_INTERNAL_STATUS.PQQ_TO_UPDATE,
|
||||
activityInternalStatus: ACTIVITY_INTERNAL_STATUS.PQ_TO_UPDATE,
|
||||
activityDisplayStatus: ACTIVITY_DISPLAY_STATUS.ENHANCING,
|
||||
amInternalStatus: ACTIVITY_AM_INTERNAL_STATUS.PQQ_REJECTED,
|
||||
amInternalStatus: ACTIVITY_AM_INTERNAL_STATUS.PQ_REJECTED,
|
||||
amDisplayStatus: ACTIVITY_AM_DISPLAY_STATUS.ENHANCING
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user