Skip to content

Commit

Permalink
feat: concurrently request data for user profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Gobot1234 committed Apr 19, 2024
1 parent e39b273 commit 79b1df4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions apps/forge/src/routes/_authenticated/_reponly/users/$id.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import { isAxiosError } from "axios";
import { Check, Loader, X } from "lucide-react";

async function getData(id: string) {
const user = await getUser(id);
const trainings = await getUserTraining(id);
const signIns = await getUserSignIns(id);
const [user, trainings, signIns] = await Promise.all([getUser(id), getUserTraining(id), getUserSignIns(id)]);
return {
user,
trainings,
Expand Down

0 comments on commit 79b1df4

Please sign in to comment.