Skip to content

Commit

Permalink
[fix] Fixed login problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
yoneyan committed May 28, 2023
1 parent 19de308 commit 00062d2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
5 changes: 4 additions & 1 deletion src/pages/Add/Add.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ export default function Add() {
enqueueSnackbar(tmpData.error, { variant: 'error' })
}
} else if (tmpData.data != null) {
if (tmpData.data?.group?.expired_status !== 0) {
if (
tmpData.data.user?.group_id !== 0 &&
tmpData.data?.group?.expired_status !== 0
) {
navigate('/dashboard')
}
setData(tmpData.data)
Expand Down
47 changes: 24 additions & 23 deletions src/pages/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default function Dashboard() {
<DashboardComponent title="Dashboard">
<Grid container spacing={3}>
<Grid item xs={12} md={8}>
{data?.group?.expired_status !== 0 && (
{data?.user?.group_id !== 0 && data?.group?.expired_status !== 0 && (
<StyledCardRoot3 key={'payment_notice'}>
<CardContent>
<Typography variant="h5" component="h2">
Expand Down Expand Up @@ -164,28 +164,29 @@ export default function Dashboard() {
</CardActions>
</StyledCardRoot3>
)}
{data?.group?.expired_status === 0 && status !== 3 && (
<StyledCardRoot3 key={'add_notice'}>
<CardContent>
<Typography variant="h5" component="h2">
申請手続きのお知らせ
</Typography>
<Chip
size={'small'}
label="重要"
color="secondary"
sx={{ marginRight: 1 }}
/>
<br />
以下の「申請ページはこちら」ボタンより手続きを進めてください
</CardContent>
<CardActions>
<Button size="small" variant="outlined" onClick={moveAddPage}>
申請ページはこちら
</Button>
</CardActions>
</StyledCardRoot3>
)}
{!(data?.user?.group_id !== 0 && data?.group?.expired_status === 0) &&
status !== 3 && (
<StyledCardRoot3 key={'add_notice'}>
<CardContent>
<Typography variant="h5" component="h2">
申請手続きのお知らせ
</Typography>
<Chip
size={'small'}
label="重要"
color="secondary"
sx={{ marginRight: 1 }}
/>
<br />
以下の「申請ページはこちら」ボタンより手続きを進めてください
</CardContent>
<CardActions>
<Button size="small" variant="outlined" onClick={moveAddPage}>
申請ページはこちら
</Button>
</CardActions>
</StyledCardRoot3>
)}
{data?.group?.expired_status === 0 &&
data?.notice?.map((notice, index) => (
<StyledCardRoot3 key={index}>
Expand Down

0 comments on commit 00062d2

Please sign in to comment.