fix: improve availablePlayers query to handle undefined playerId
This commit is contained in:
@@ -37,7 +37,7 @@ export default async function EditUserPage({
|
|||||||
where: {
|
where: {
|
||||||
OR: [
|
OR: [
|
||||||
{ user: null },
|
{ user: null },
|
||||||
{ id: user.playerId || -1 }, // Include the currently associated player if any
|
...(user.playerId ? [{ id: user.playerId }] : []), // Include the currently associated player if any
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
orderBy: { name: "asc" },
|
orderBy: { name: "asc" },
|
||||||
|
|||||||
Reference in New Issue
Block a user