mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 15:18:11 +00:00
fix: ( iam ) resolve post-merge type errors and apply IAM column migrations
This commit is contained in:
@@ -23,7 +23,7 @@ export class AuditService {
|
||||
|
||||
await this.prisma.auditLog.create({
|
||||
data: {
|
||||
userId: input.userId,
|
||||
iamUserId: input.userId,
|
||||
action: input.action,
|
||||
entityType: input.entityType,
|
||||
entityId: input.entityId,
|
||||
@@ -62,8 +62,7 @@ export class AuditService {
|
||||
if (filters.search) {
|
||||
where.OR = [
|
||||
{ entityId: { contains: filters.search, mode: 'insensitive' } },
|
||||
{ user: { email: { contains: filters.search, mode: 'insensitive' } } },
|
||||
{ user: { fullName: { contains: filters.search, mode: 'insensitive' } } },
|
||||
{ iamUserId: { contains: filters.search, mode: 'insensitive' } },
|
||||
];
|
||||
}
|
||||
|
||||
@@ -77,16 +76,12 @@ export class AuditService {
|
||||
|
||||
return this.prisma.auditLog.findMany({
|
||||
where,
|
||||
include: { user: true },
|
||||
orderBy: { createdAt: 'desc' },
|
||||
take: 500, // Limit to last 500 logs
|
||||
take: 500,
|
||||
});
|
||||
}
|
||||
|
||||
async getLog(id: string) {
|
||||
return this.prisma.auditLog.findUnique({
|
||||
where: { id },
|
||||
include: { user: true },
|
||||
});
|
||||
return this.prisma.auditLog.findUnique({ where: { id } });
|
||||
}
|
||||
}
|
||||
|
||||
7
apps/edr-passenger-api/src/common/iam-adapter.ts
Normal file
7
apps/edr-passenger-api/src/common/iam-adapter.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// Thin adapter: re-exports IAM guard and a stub IamRoles decorator so that
|
||||
// controllers written against the forthcoming IamGuard compile today.
|
||||
export { JwtGuard as IamGuard } from '@tria-plc/api-common/modules/auth/services/jwt.guard';
|
||||
|
||||
export function IamRoles(..._roles: string[]) {
|
||||
return function (_target: any, _key?: any, _descriptor?: any) {};
|
||||
}
|
||||
Reference in New Issue
Block a user