mirror of
https://github.com/immich-app/immich.git
synced 2026-03-04 09:57:33 +03:00
refactor(server): user endpoints (#9730)
* refactor(server): user endpoints * fix repos * fix unit tests --------- Co-authored-by: Daniel Dietzler <mail@ddietzler.dev> Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -34,7 +34,9 @@ export class ApiKeyRepository implements IKeyRepository {
|
||||
},
|
||||
where: { key: hashedToken },
|
||||
relations: {
|
||||
user: true,
|
||||
user: {
|
||||
metadata: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -18,7 +18,14 @@ export class SessionRepository implements ISessionRepository {
|
||||
|
||||
@GenerateSql({ params: [DummyValue.STRING] })
|
||||
getByToken(token: string): Promise<SessionEntity | null> {
|
||||
return this.repository.findOne({ where: { token }, relations: { user: true } });
|
||||
return this.repository.findOne({
|
||||
where: { token },
|
||||
relations: {
|
||||
user: {
|
||||
metadata: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
getByUserId(userId: string): Promise<SessionEntity[]> {
|
||||
|
||||
Reference in New Issue
Block a user