fix; remover user error and add log

This commit is contained in:
xion 2025-02-28 15:04:07 +08:00
parent ae829c6181
commit e41749404b
2 changed files with 13 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@kevisual/code-center-module", "name": "@kevisual/code-center-module",
"version": "0.0.10", "version": "0.0.11-alpha.1",
"description": "", "description": "",
"main": "dist/system.mjs", "main": "dist/system.mjs",
"module": "dist/system.mjs", "module": "dist/system.mjs",

View File

@ -69,6 +69,12 @@ export class Org extends Model {
users.push({ role: opts?.role || 'member', uid: user.id }); users.push({ role: opts?.role || 'member', uid: user.id });
} }
await Org.update({ users }, { where: { id: this.id } }); await Org.update({ users }, { where: { id: this.id } });
console.log(
'org users',
this.username,
users.map((u) => [u.uid, u.role]),
);
} }
/** /**
* operateId id * operateId id
@ -88,7 +94,12 @@ export class Org extends Model {
} }
} }
await user.expireOrgs(); await user.expireOrgs();
const users = this.users.filter((u) => u.uid !== user.id || u.role !== 'owner'); const users = this.users.filter((u) => u.uid !== user.id || u.role === 'owner');
console.log(
'org users',
this.username,
users.map((u) => [u.uid, u.role]),
);
await Org.update({ users }, { where: { id: this.id } }); await Org.update({ users }, { where: { id: this.id } });
} }
/** /**