mirror of
https://github.com/spacebarchat/server.git
synced 2026-09-16 23:25:05 +00:00
added clean_data to places after a member is created but not constructed to allow proper json creation.
This commit is contained in:
@@ -212,6 +212,7 @@ export class User extends BaseClass {
|
||||
}
|
||||
|
||||
toPublicUser() {
|
||||
this.clean_data();
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const user: any = {};
|
||||
PublicUserProjection.forEach((x) => {
|
||||
@@ -221,6 +222,7 @@ export class User extends BaseClass {
|
||||
}
|
||||
|
||||
toPrivateUser(extraFields: (keyof User)[] = []) {
|
||||
this.clean_data();
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const user: any = {};
|
||||
[...PrivateUserProjection, ...extraFields].forEach((x) => {
|
||||
|
||||
Reference in New Issue
Block a user