Skip to content

Commit

Permalink
format files
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkPhoenix2704 committed Apr 28, 2024
1 parent fb5fc66 commit d855b54
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
7 changes: 3 additions & 4 deletions app/events/ui/modal/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@ export default async function createTeam(
const admin = await db.user.findUnique({
where: {
id: userId,
}
})
},
});

if(!admin) {
if (!admin) {
return "User not found!";
}


const teamLead = await db.teamMember.findUnique({
where: {
userId_eventId: {
Expand Down
12 changes: 6 additions & 6 deletions app/events/ui/modal/updateTeamAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export default async function updateTeam(

const data = validation.data;

const teamMember = await db.teamMember.findUnique({
where: {
userId: userId,
eventId: eventId
}
})
const teamMember = await db.teamMember.findUnique({
where: {
userId: userId,
eventId: eventId,
},
});

const admin = await db.user.findUnique({
where: {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "next dev --turbo",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "biome lint ./",
"format": "biome format ./ --write"
},
"dependencies": {
"@hookform/resolvers": "^3.3.4",
Expand Down
4 changes: 2 additions & 2 deletions utils/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export const getCurrentEvent = async (user: User | null) => {
const currentEvent = await db.event.findFirst({
where: {
status: {
in: [EventStatus.ACTIVE, EventStatus.REGISTRATION]
}
in: [EventStatus.ACTIVE, EventStatus.REGISTRATION],
},
},
select: {
id: true,
Expand Down
10 changes: 6 additions & 4 deletions utils/lucia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ import { env } from "@/utils/config";
const adapter = new PrismaAdapter(db.session, db.user);

export const lucia = new Lucia(adapter, {
sessionExpiresIn: new TimeSpan(8, 'd'),
sessionExpiresIn: new TimeSpan(8, "d"),
sessionCookie: {
expires: true,
attributes: {
secure: env.NODE_ENV === "production",
sameSite: 'strict',
domain: env.NODE_ENV === "production" ? new URL(env.NEXT_PUBLIC_BASE_URL).hostname : undefined,
sameSite: "strict",
domain:
env.NODE_ENV === "production"
? new URL(env.NEXT_PUBLIC_BASE_URL).hostname
: undefined,
},
},
getUserAttributes: (attributes) => {
Expand Down Expand Up @@ -79,7 +82,6 @@ export const logout = async () => {
sessionCookie.name,
sessionCookie.value,
sessionCookie.attributes,

);
};

Expand Down

0 comments on commit d855b54

Please sign in to comment.