-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
65 additions
and
21 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { ConvexHttpClient } from "convex/browser"; | ||
import { api } from "../../../../../../convex/_generated/api"; | ||
import { Id } from "../../../../../../convex/_generated/dataModel"; | ||
|
||
export async function GET( | ||
request: Request, | ||
{ params }: { params: { id: string } } | ||
) { | ||
const {id} = params; | ||
|
||
|
||
if (!id) return new Response('Parameters missing!!',{status: 401}); | ||
|
||
const client = new ConvexHttpClient(process.env.NEXT_PUBLIC_CONVEX_URL!); | ||
|
||
const teamInfo = await client.query(api.teams.getTeamById,{_id:id as Id<"teams">}); | ||
|
||
const memberDataPromises = teamInfo.teamMembers.map((mem:string) => | ||
client.query(api.user.getUser, { email: mem }) | ||
); | ||
|
||
const results = await Promise.all(memberDataPromises); | ||
|
||
const memberData = results.flatMap((result) => result || []); | ||
|
||
return Response.json({memberData}); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
export default function Page() { | ||
return ( | ||
<div>Page</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react' | ||
|
||
export default function MemberCarousel() { | ||
return ( | ||
<div>MemberCarousel</div> | ||
) | ||
} |