added button for administration

This commit is contained in:
daniel31x13
2024-07-03 17:29:33 -04:00
parent c67526e54c
commit 7c95761990
7 changed files with 26 additions and 7 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ export default async function users(req: NextApiRequest, res: NextApiResponse) {
},
});
const isServerAdmin = process.env.ADMINISTRATOR === user?.username;
const isServerAdmin = user?.id === Number(process.env.NEXT_PUBLIC_ADMIN || 1);
const userId = isServerAdmin ? Number(req.query.id) : token.id;