fetch admin avatar from admin endpoint instead of anonymous user
This commit is contained in:
@@ -176,7 +176,7 @@ export default async function adminAuthRoutes(app: FastifyInstance) {
|
||||
}
|
||||
const admin = await prisma.adminUser.findUnique({
|
||||
where: { id: req.adminId },
|
||||
select: { role: true, displayName: true, teamTitle: true },
|
||||
select: { role: true, displayName: true, teamTitle: true, linkedUserId: true, linkedUser: { select: { avatarPath: true } } },
|
||||
});
|
||||
if (!admin) {
|
||||
reply.send({ isAdmin: false });
|
||||
@@ -187,6 +187,7 @@ export default async function adminAuthRoutes(app: FastifyInstance) {
|
||||
role: admin.role,
|
||||
displayName: admin.displayName ? decrypt(admin.displayName, masterKey) : null,
|
||||
teamTitle: admin.teamTitle ? decrypt(admin.teamTitle, masterKey) : null,
|
||||
avatarUrl: admin.linkedUser?.avatarPath ? `/api/v1/avatars/${admin.linkedUserId}` : null,
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user