mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-21 23:22:35 +02:00
fix: team list is not visible and change teams class
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user