Skip to content

Commit

Permalink
#9 feat : getPartyList api
Browse files Browse the repository at this point in the history
  • Loading branch information
luckylooky2 committed Mar 19, 2023
1 parent ce3d851 commit a653e47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions front/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import qs from "query-string";
import Loading from "components/common/Loading";
import instance from "api/api";
import "styles/index.scss";
import { es } from "date-fns/locale";

const Home = (): JSX.Element => {
const navigate = useNavigate();
Expand All @@ -18,8 +17,8 @@ const Home = (): JSX.Element => {
instance.defaults.headers.common[
"Authorization"
] = `Bearer ${params.token}`;
navigate("/party");
}
navigate("/party");
};

useEffect(() => {
Expand Down
10 changes: 5 additions & 5 deletions front/src/pages/party.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ const Party = (): JSX.Element => {
const [isOpen, setIsOpen] = useState<boolean>(false);

const getPartyList = async () => {
// const response = await PartyService.getPartyList();
// console.log(response.data);
// setList(response.data);
const response = await PartyService.getPartyList();
console.log(response.data);
setList(response.data);
};

useEffect(() => {
Expand All @@ -104,8 +104,8 @@ const Party = (): JSX.Element => {
return (
<Box sx={{ height: "100%" }}>
<Stack sx={{ overflow: "auto", px: 1, height: "90%" }}>
{list.map((item) => (
<PartyCard party={item} />
{list.map((item, index) => (
<PartyCard key={index} party={item} />
))}
</Stack>
<Box sx={{ display: "flex", justifyContent: "flex-end" }}>
Expand Down

0 comments on commit a653e47

Please sign in to comment.