Report anzeige für auto-reports verbessert
This commit is contained in:
@@ -47,30 +47,42 @@ export const AccountLog = ({ sameIPLogs, userId }: { sameIPLogs: Log[]; userId:
|
||||
</div>
|
||||
}
|
||||
getFilter={(searchTerm) => {
|
||||
return {
|
||||
AND: [
|
||||
onlyImportant
|
||||
? {
|
||||
type: {
|
||||
in: ["REGISTER", "PROFILE_CHANGE"],
|
||||
},
|
||||
}
|
||||
: {},
|
||||
{
|
||||
AND: [
|
||||
{ ip: { contains: searchTerm } },
|
||||
{ browser: { contains: searchTerm } },
|
||||
{
|
||||
id: {
|
||||
in: sameIPLogs
|
||||
.filter((log) => log.id.toString().includes(searchTerm))
|
||||
.map((log) => log.id),
|
||||
},
|
||||
if (onlyImportant) {
|
||||
return {
|
||||
AND: [
|
||||
{ ip: { contains: searchTerm } },
|
||||
{ browser: { contains: searchTerm } },
|
||||
{
|
||||
id: {
|
||||
in: sameIPLogs
|
||||
.filter((log) => log.id.toString().includes(searchTerm))
|
||||
.map((log) => log.id),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
} as Prisma.LogWhereInput;
|
||||
},
|
||||
],
|
||||
} as Prisma.LogWhereInput;
|
||||
} else {
|
||||
return {
|
||||
OR: [
|
||||
{
|
||||
AND: [
|
||||
{ ip: { contains: searchTerm } },
|
||||
{ browser: { contains: searchTerm } },
|
||||
{
|
||||
id: {
|
||||
in: sameIPLogs
|
||||
.filter((log) => log.id.toString().includes(searchTerm))
|
||||
.map((log) => log.id),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
userId: userId,
|
||||
},
|
||||
],
|
||||
} as Prisma.LogWhereInput;
|
||||
}
|
||||
}}
|
||||
include={{
|
||||
User: true,
|
||||
|
||||
Reference in New Issue
Block a user