Skip to content

Commit

Permalink
suport kickoff
Browse files Browse the repository at this point in the history
  • Loading branch information
armintalaie committed Sep 21, 2024
1 parent 5ea01bc commit 019ffb4
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/app/api/projects/refresh/route.ts

This file was deleted.

35 changes: 35 additions & 0 deletions src/app/api/v1/teams/forms/[id]/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { db } from "@/db";
import { NextRequest, NextResponse } from "next/server";
export async function GET(
request: NextRequest,
{ params }: { params: { id: string } },
) {
const members = await db.submissions.findMany({
where: {
form_id: Number(params.id),
},
include: {
applications: true,
users: true,
},
});

const res = members
.filter(
(member) =>
member.applications && member.applications.status === "accepted",
)
.map((member) => {
if (!member.applications) {
return null;
}
return {
email: member.users.email,
team: {
id: Number(member.applications.team_id),
},
};
});

return NextResponse.json(res);
}

0 comments on commit 019ffb4

Please sign in to comment.