completed Account Log
This commit is contained in:
@@ -41,6 +41,7 @@ export const getPublicUser = (
|
||||
user: User,
|
||||
options = {
|
||||
ignorePrivacy: false,
|
||||
fullLastName: false,
|
||||
},
|
||||
): PublicUser => {
|
||||
const lastName = user.lastname
|
||||
@@ -49,6 +50,17 @@ export const getPublicUser = (
|
||||
.map((part) => `${part[0] || ""}.`)
|
||||
.join(" ");
|
||||
|
||||
if (options.fullLastName) {
|
||||
return {
|
||||
firstname: user.firstname,
|
||||
lastname: user.settingsHideLastname && !options.ignorePrivacy ? "" : user.lastname,
|
||||
fullName:
|
||||
`${user.firstname} ${user.settingsHideLastname && !options.ignorePrivacy ? "" : user.lastname}`.trim(),
|
||||
publicId: user.publicId,
|
||||
badges: user.badges,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
firstname: user.firstname,
|
||||
lastname: user.settingsHideLastname && !options.ignorePrivacy ? "" : lastName.trim(), // Only take the first letter of each section of the last name
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
model AuditLog {
|
||||
model Penalty {
|
||||
id Int @id @default(autoincrement())
|
||||
userId String
|
||||
createdUserId String?
|
||||
reportId Int?
|
||||
|
||||
// Generalized action type to cover penalties and user history events
|
||||
action AuditLogAction?
|
||||
reason String?
|
||||
type PenaltyType
|
||||
reason String
|
||||
until DateTime?
|
||||
|
||||
suspended Boolean @default(false)
|
||||
@@ -19,13 +18,9 @@ model AuditLog {
|
||||
Report Report? @relation(fields: [reportId], references: [id])
|
||||
}
|
||||
|
||||
enum AuditLogAction {
|
||||
// Penalty actions
|
||||
enum PenaltyType {
|
||||
KICK
|
||||
TIME_BAN
|
||||
PERMISSIONS_REVOCED
|
||||
BAN
|
||||
// User history events
|
||||
USER_DELETED
|
||||
USER_PROFILE_UPDATED
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user