Merge pull request

This commit is contained in:
prafull-opensignlabs
2025-04-05 06:01:24 +00:00
parent fca45ced38
commit d7b7ad6285
49 changed files with 992 additions and 1443 deletions
@@ -0,0 +1,27 @@
export default async function updateTenant(request) {
const { tenantId, details } = request.params;
if (!tenantId || !details) {
throw new Parse.Error(400, 'Missing tenantId or details.');
}
if (!request.user) {
throw new Parse.Error(Parse.Error.INVALID_SESSION_TOKEN, 'unauthorized');
}
try {
const tenant = new Parse.Object('partners_Tenant');
tenant.id = tenantId;
// Update tenant details
Object.keys(details).forEach(key => {
tenant.set(key, details?.[key]);
});
const tenantRes = await tenant.save(null, { useMasterKey: true });
if (tenantRes) {
const res = JSON.parse(JSON.stringify(tenantRes));
return res;
}
} catch (error) {
throw error;
}
}