fix: team list is not visible and change teams class

This commit is contained in:
prafull-opensignlabs
2024-07-04 20:56:57 +05:30
parent 450de195a7
commit d77477f3d1
15 changed files with 448 additions and 391 deletions
@@ -0,0 +1,30 @@
export default async function TeamsAftersave(req) {
if (!req.original) {
try {
const Ancestors = req.object.get('Ancestors');
let updatedAncestors;
if (Ancestors && Ancestors.length > 0) {
updatedAncestors = [
...Ancestors,
{
__type: 'Pointer',
className: 'contracts_Teams',
objectId: req.object.id,
},
];
} else {
updatedAncestors = [
{
__type: 'Pointer',
className: 'contracts_Teams',
objectId: req.object.id,
},
];
}
req.object.set('Ancestors', updatedAncestors);
await req.object.save(null, { useMasterKey: true });
} catch (err) {
console.log('Err in team aftersave', err);
}
}
}