Fixe type errors

This commit is contained in:
PxlLoewe
2026-01-30 17:14:16 +01:00
parent 76d4355320
commit 8555b901a5
2 changed files with 7 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/dev/types/routes.d.ts";
import "./.next/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

View File

@@ -39,9 +39,9 @@ export const DISCORD_ROLES = {
export const getPublicUser = (
user: User,
options = {
ignorePrivacy: false,
fullLastName: false,
options?: {
ignorePrivacy?: boolean;
fullLastName?: boolean;
},
): PublicUser => {
const lastName = user.lastname
@@ -50,7 +50,7 @@ export const getPublicUser = (
.map((part) => `${part[0] || ""}.`)
.join(" ");
if (options.fullLastName) {
if (options?.fullLastName) {
return {
firstname: user.firstname,
lastname: user.settingsHideLastname && !options.ignorePrivacy ? "" : user.lastname,
@@ -63,9 +63,9 @@ export const getPublicUser = (
return {
firstname: user.firstname,
lastname: user.settingsHideLastname && !options.ignorePrivacy ? "" : lastName.trim(), // Only take the first letter of each section of the last name
lastname: user.settingsHideLastname && !options?.ignorePrivacy ? "" : lastName.trim(), // Only take the first letter of each section of the last name
fullName:
`${user.firstname} ${user.settingsHideLastname && !options.ignorePrivacy ? "" : lastName}`.trim(),
`${user.firstname} ${user.settingsHideLastname && !options?.ignorePrivacy ? "" : lastName}`.trim(),
publicId: user.publicId,
badges: user.badges,
};