manifests

This commit is contained in:
2023-09-27 22:27:52 +01:00
parent 8870c1f7b8
commit e9a1653c4e
17 changed files with 683 additions and 10 deletions

View File

@@ -6,7 +6,7 @@ import LoadingBar from '../components/LoadingBar'
import { useAppSelector } from '../app/hooks'
import { useGetPanelByNameQuery } from '../app/api/panels'
import type { Panel } from '../app/types/common'
import type { ErrorResponse } from '../app/types/api'
import type { QueryError, ErrorResponse } from '../app/types/api'
export type PanelContext = {
panel: Panel;
@@ -63,8 +63,8 @@ function PanelLayout() {
} 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 {

View File

@@ -7,7 +7,7 @@ import LoadingBar from './LoadingBar'
import { User } from '../app/types/common'
import { useAppSelector } from '../app/hooks'
import { useGetUserByNameQuery } from '../app/api/users'
import type { ErrorResponse } from '../app/types/api'
import type { ErrorResponse, QueryError } from '../app/types/api'
export type UserContext = {
user: User
@@ -40,8 +40,8 @@ function UserLayout() {
} 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 {