mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 17:23:18 +00:00
add extraFields optional param on toPrivateUser, expose rights on READY
This commit is contained in:
1 parent
ab6a1b7104
commit
592d68379b
2 files changed
+3
-3
No files matched your search
@@ -197,10 +197,10 @@ export class User extends BaseClass {
|
||||
return user as PublicUser;
|
||||
}
|
||||
|
||||
toPrivateUser() {
|
||||
toPrivateUser(extraFields: (keyof User)[] = []) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const user: any = {};
|
||||
PrivateUserProjection.forEach((x) => {
|
||||
[...PrivateUserProjection, ...extraFields].forEach((x) => {
|
||||
user[x] = this[x];
|
||||
});
|
||||
return user as UserPrivate;
|
||||
|
||||
Reference in new issue
Block a user