Skip to content

Commit

Permalink
Merge pull request #68 from ckan-project/dev
Browse files Browse the repository at this point in the history
[feat] 헤더 UI 수정, 시각화 API 추가, 스크랩 예외처리 수정
  • Loading branch information
minSsan authored Jun 3, 2024
2 parents 7a7353d + ba4af28 commit 33dbab1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/components/scrap-button/scrap-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export function ScrapButton({
return router.push("/login");
}

if (session.user.role === "ROLE_ADMIN") {
alert("관리자는 이용할 수 없는 서비스입니다.");
return;
}

const func = like ? deleteScrap : createScrap;

const response = await func(
Expand Down Expand Up @@ -59,7 +64,9 @@ export function ScrapButton({
},
);
}
fetchLike();
if (status === "authenticated" && session.user.role === "ROLE_USER") {
fetchLike();
}
}, []);

return (
Expand Down
3 changes: 1 addition & 2 deletions src/page-src/layout/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,12 @@ const HeaderWrapper = styled.div`
margin-top: 0.906rem;
display: flex;
align-items: center;
justify-content: center;
justify-content: space-between;
`;

const MenuWrapper = styled.ul`
width: 46rem;
height: 100%;
margin-left: 5rem;
display: table;
table-layout: fixed;
`;
Expand Down
6 changes: 5 additions & 1 deletion src/shared/api/dataset/createDataset.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CreateDatasetBody } from "../../types/dataset";
import { SERVER_API } from "../config";
import { DATASET_API, SERVER_API } from "../config";
import { CreateDatasetResponse } from "./type";

type Props = {
Expand Down Expand Up @@ -51,6 +51,10 @@ export async function createDataset({ grantType, token, body, file }: Props) {
},
);

await fetch(`${DATASET_API}/${res.result.datasetId}/resource/table`, {
method: "POST",
});

return fileResponse;
} catch (error) {
console.error(error);
Expand Down

0 comments on commit 33dbab1

Please sign in to comment.