diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-04-12 01:52:25 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-04-12 01:52:25 +0900 |
| commit | 2ff3069d23aa688cea5a3bd204236f2f2f64c201 (patch) | |
| tree | 479448f49c2204e5729ed28a1af34a86e354492b /src/models/entities/user.ts | |
| parent | トランザクションを使用してアンケートレコードの挿入... (diff) | |
| download | misskey-2ff3069d23aa688cea5a3bd204236f2f2f64c201.tar.gz misskey-2ff3069d23aa688cea5a3bd204236f2f2f64c201.tar.bz2 misskey-2ff3069d23aa688cea5a3bd204236f2f2f64c201.zip | |
トランザクションを使うようにしたり
Diffstat (limited to 'src/models/entities/user.ts')
| -rw-r--r-- | src/models/entities/user.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/models/entities/user.ts b/src/models/entities/user.ts index ebf07ff3ff..e40c32a76f 100644 --- a/src/models/entities/user.ts +++ b/src/models/entities/user.ts @@ -205,6 +205,14 @@ export class User { comment: 'The native access token of the User. It will be null if the origin of the user is local.' }) public token: string | null; + + constructor(data: Partial<User>) { + if (data == null) return; + + for (const [k, v] of Object.entries(data)) { + (this as any)[k] = v; + } + } } export interface ILocalUser extends User { |