Skip to content

Commit

Permalink
fixed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
03haax committed Apr 16, 2024
2 parents b3cfe0f + 8de7c29 commit 8922105
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/lib/server/keycloak/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ async function hasEmail(email: string) {
}

async function getEmail(username: string) {
if (!enabled) return false;
if (!enabled) return;
const client = await connect();
const user = await client.users.find({ username });
if (user.length === 1) return user[0]?.email;
Expand Down
8 changes: 4 additions & 4 deletions src/routes/(app)/members/[studentId]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ export const load: PageServerLoad = async ({ locals, params }) => {
member.id,
);

let email;
if (member.studentId !== null) {
email = await keycloak.getEmail(member.studentId);
}
const email =
member.studentId !== null
? await keycloak.getEmail(member.studentId)
: undefined;

return {
form: await superValidate(member, memberSchema),
Expand Down
3 changes: 1 addition & 2 deletions vercel.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

if test "$VERCEL_ENV" = "production"
then
if [[ $VERCEL_ENV == "production" ]] ; then
pnpm run build && pnpm prisma migrate deploy
else
# prod and preview use the same database.
Expand Down

0 comments on commit 8922105

Please sign in to comment.