Skip to content

Commit

Permalink
feat: 비크루 회원 아티클 작성 못하도록 구현
Browse files Browse the repository at this point in the history
Co-authored-by: 이도현 <[email protected]>
  • Loading branch information
hae-on and Creative-Lee committed Oct 4, 2023
1 parent 596059f commit 426afe0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/contexts/UserProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const DEFAULT_USER = {
userId: null,
username: null,
nickname: null,
role: null,
role: '',
imageUrl: null,
accessToken: null,
isLoggedIn: false,
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/pages/ArticleListPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ const ArticleListPage = () => {
const [checked, setChecked] = useState(false);

const { user } = useContext(UserContext);
const { isLoggedIn } = user;
const { isLoggedIn, role } = user;

const authorized = role === 'CREW' && isLoggedIn;

const { data: filteredArticles = [], refetch: getFilteredArticles } = useGetFilteredArticleQuery(
selectedCourse.value,
Expand Down Expand Up @@ -66,7 +68,7 @@ const ArticleListPage = () => {
<ArticleBookmarkFilter checked={checked} handleCheckBookmark={handleCheckBookmark} />
)}
</FilteringWrapper>
{isLoggedIn && (
{authorized && (
<Button
type="button"
size="X_SMALL"
Expand Down

0 comments on commit 426afe0

Please sign in to comment.