Merge pull request

This commit is contained in:
prafull-opensignlabs
2026-03-04 07:31:19 +00:00
parent 2e2e535b70
commit acb0f3083c
158 changed files with 40172 additions and 1456 deletions
@@ -1,28 +1,24 @@
import { useLocal } from '../../Utils.js';
import getPresignedUrl, { presignedlocalUrl } from './getSignedUrl.js';
const resolveUrl = async rawUrl => {
const isLocal = useLocal == 'true';
const shouldUsePresigned = useLocal !== 'true';
if (!rawUrl) return rawUrl;
if (shouldUsePresigned) {
return await getPresignedUrl(rawUrl);
} else if (isLocal) {
return presignedlocalUrl(rawUrl);
}
};
async function UserAfterFind(request) {
if (useLocal !== 'true') {
if (request.objects.length === 1) {
if (request.objects) {
const obj = request.objects[0];
const ProfilePic = obj?.get('ProfilePic') && obj?.get('ProfilePic');
if (ProfilePic) {
obj.set('ProfilePic', getPresignedUrl(ProfilePic));
}
return [obj];
}
}
} else if (useLocal == 'true') {
if (request.objects.length === 1) {
if (request.objects) {
const obj = request.objects[0];
const ProfilePic = obj?.get('ProfilePic') && obj?.get('ProfilePic');
if (ProfilePic) {
obj.set('ProfilePic', presignedlocalUrl(ProfilePic));
}
return [obj];
}
if (request.objects.length === 1) {
if (request.objects) {
const obj = request.objects[0];
const ProfilePic = obj?.get('ProfilePic') && obj?.get('ProfilePic');
if (ProfilePic) obj.set('ProfilePic', await resolveUrl(ProfilePic));
return [obj];
}
}
}