mirror of
https://github.com/hexolan/panels.git
synced 2026-03-27 04:44:10 +00:00
manifests
This commit is contained in:
@@ -10,7 +10,7 @@ import LoadingBar from '../components/LoadingBar'
|
||||
import { useAppSelector } from '../app/hooks'
|
||||
import { useGetPanelPostQuery } from '../app/api/posts'
|
||||
import type { PanelContext } from '../components/PanelLayout'
|
||||
import type { ErrorResponse } from '../app/types/api'
|
||||
import type { QueryError, ErrorResponse } from '../app/types/api'
|
||||
import type { Comment } from '../app/types/common'
|
||||
|
||||
type PanelPostPageParams = {
|
||||
@@ -37,8 +37,8 @@ function PanelPostPage() {
|
||||
} else if (!data) {
|
||||
if (!error) {
|
||||
throw Error('Unknown error occured')
|
||||
} else if ('data' in error) {
|
||||
const errResponse = error.data as ErrorResponse
|
||||
} else if ((error as QueryError).data) {
|
||||
const errResponse = (error as QueryError).data as ErrorResponse
|
||||
if (errResponse.msg) {
|
||||
throw Error(errResponse.msg)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user