Skip to content

Commit 03217a6

Browse files
committed
Fix MeQueryType
1 parent 5c53a67 commit 03217a6

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

frontend/src/components/post/PostDetail.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ const PostDetail: React.FC = () => {
7272
client
7373
.resetStore()
7474
.then(() =>
75-
history.push(postQuery.data.post.published ? '/' : '/drafts'),
75+
history.push(
76+
postQuery.data && postQuery.data.post.published ? '/' : '/drafts',
77+
),
7678
)
7779
})
7880
.catch((e) => {

frontend/src/context/MeQueryContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ interface MeQueryType {
1212
loading: boolean
1313
}
1414

15-
export default React.createContext<MeQueryType | null>(null)
15+
export default React.createContext<MeQueryType | undefined>(undefined)

frontend/src/routes/RoutesAuth.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,7 @@ import MeQueryContext from './../context/MeQueryContext'
2121
import UserType from './../types/User'
2222

2323
interface MeQueryResponse {
24-
data: {
25-
me: UserType
26-
}
27-
error: {
28-
message: string
29-
}
30-
loading: boolean
24+
me: UserType
3125
}
3226

3327
const RoutesAuth: React.FC = () => {

0 commit comments

Comments
 (0)