Skip to content

Commit

Permalink
easy
Browse files Browse the repository at this point in the history
  • Loading branch information
0-don committed Mar 17, 2024
1 parent 2465760 commit 91b6b14
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/routes/team.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AiOutlineGlobal, AiOutlineUserAdd } from "solid-icons/ai";
import { For, Show, createSignal, onMount } from "solid-js";
import { For, Show, createResource } from "solid-js";
import { Card, CardDescription, CardHeader } from "~/components/ui/card";
import { Staff } from "~/types";
import { STAFF_MEMBERS } from "~/utils/staffMembers";
Expand All @@ -8,18 +8,11 @@ import { Header } from "../components/elements/Header";
import { TitleDescription } from "../components/seo/TitleDescription";

export default function Team() {
const [members, setMembers] = createSignal<Staff[]>([]);

onMount(async () => {
try {
const res = await fetch(
"https://bot.coding.global/api/693908458986143824/staff",
);
const data: Staff[] = await res.json();
setMembers(data);
} catch (error) {
console.error(error);
}
const [members] = createResource(async () => {
const response = await fetch(
"https://bot.coding.global/api/693908458986143824/staff",
);
return (await response.json()) as Staff[];
});

return (
Expand Down

0 comments on commit 91b6b14

Please sign in to comment.