Caught object that wasn&t an error.
; + const { data: session } = useSession(); + const [data, setData] = useState< + [getAppsResponse, getCategoriesResponse, getDevicesResponse] | null + >(null); + + useEffect(() => { + async function getData() { + const token = (session as any)?.accessToken; + const data = await getAppData(searchParams, token); + setData(data); } - return ( - <> -Error while rendering
-
- {JSON.stringify(e.message)}
-
- >
- );
- }
+
+ getData();
+ }, [searchParams, session]);
return (
<>
Loading new data...
} > ); } diff --git a/src/badgehub-api-client/generated/models/app.ts b/src/badgehub-api-client/generated/models/app.ts new file mode 100644 index 0000000..b636277 --- /dev/null +++ b/src/badgehub-api-client/generated/models/app.ts @@ -0,0 +1,14 @@ +/** + * Generated by orval v7.1.1 🍺 + * Do not edit manually. + * badgehub-api + * Node project for the BadgeHub API + * OpenAPI spec version: 3 + */ + +export interface App { + category_slug: string; + name: string; + slug: string; + user_name: string; +} diff --git a/src/badgehub-api-client/generated/models/appDetails.ts b/src/badgehub-api-client/generated/models/appDetails.ts new file mode 100644 index 0000000..ae64f5a --- /dev/null +++ b/src/badgehub-api-client/generated/models/appDetails.ts @@ -0,0 +1,16 @@ +/** + * Generated by orval v7.1.1 🍺 + * Do not edit manually. + * badgehub-api + * Node project for the BadgeHub API + * OpenAPI spec version: 3 + */ + +export interface AppDetails { + category_slug: string; + description: string; + devices: string[]; + name: string; + slug: string; + user_name: string; +} diff --git a/src/badgehub-api-client/generated/models/device.ts b/src/badgehub-api-client/generated/models/device.ts new file mode 100644 index 0000000..3ea9b80 --- /dev/null +++ b/src/badgehub-api-client/generated/models/device.ts @@ -0,0 +1,12 @@ +/** + * Generated by orval v7.1.1 🍺 + * Do not edit manually. + * badgehub-api + * Node project for the BadgeHub API + * OpenAPI spec version: 3 + */ + +export interface Device { + name: string; + slug: string; +} diff --git a/src/badgehub-api-client/generated/models/getAppDetails404.ts b/src/badgehub-api-client/generated/models/getAppDetails404.ts new file mode 100644 index 0000000..a0dd5eb --- /dev/null +++ b/src/badgehub-api-client/generated/models/getAppDetails404.ts @@ -0,0 +1,11 @@ +/** + * Generated by orval v7.1.1 🍺 + * Do not edit manually. + * badgehub-api + * Node project for the BadgeHub API + * OpenAPI spec version: 3 + */ + +export type GetAppDetails404 = { + reason: string; +}; diff --git a/src/badgehub-api-client/generated/models/index.ts b/src/badgehub-api-client/generated/models/index.ts index 068e34f..c31296f 100644 --- a/src/badgehub-api-client/generated/models/index.ts +++ b/src/badgehub-api-client/generated/models/index.ts @@ -6,7 +6,9 @@ * OpenAPI spec version: 3 */ +export * from './app'; export * from './appCategoryName'; +export * from './appDetails'; export * from './appMetadataJSON'; export * from './appMetadataJSONFileMappingsItem'; export * from './badge'; @@ -14,8 +16,10 @@ export * from './category'; export * from './dbInsertAppMetadataJSONPartial'; export * from './dbInsertAppMetadataJSONPartialFileMappingsItem'; export * from './dependency'; +export * from './device'; export * from './fileMetadata'; export * from './getApp404'; +export * from './getAppDetails404'; export * from './getAppsParams'; export * from './pickDBInsertProjectExcludeKeyofDBInsertProjectSlug'; export * from './pickDBInsertUserExcludeKeyofDBInsertUserId'; diff --git a/src/badgehub-api-client/generated/swagger/private/private.ts b/src/badgehub-api-client/generated/swagger/private/private.ts index 6a62450..8e5053c 100644 --- a/src/badgehub-api-client/generated/swagger/private/private.ts +++ b/src/badgehub-api-client/generated/swagger/private/private.ts @@ -12,7 +12,6 @@ import type { ProjectSlug, Uint8Array, UserProps, - Version, WriteFileBody } from '../../models' import { fetchWithBaseUrl } from '../../../../fetch-from-api'; @@ -243,7 +242,7 @@ export const changeAppMetadata = async (slug: string, * Upload a file to the latest draft version of the project. */ export type writeZipResponse = { - data: Version; + data: void; status: number; } diff --git a/src/components/Account/index.tsx b/src/components/Account/index.tsx index 4214885..c412449 100644 --- a/src/components/Account/index.tsx +++ b/src/components/Account/index.tsx @@ -20,6 +20,7 @@ export function Account() { return ( <>JWT: {(session as any)?.accessToken}
{html} > ); diff --git a/src/components/Filter/index.tsx b/src/components/Filter/index.tsx index 4e570ce..344dbd3 100644 --- a/src/components/Filter/index.tsx +++ b/src/components/Filter/index.tsx @@ -3,11 +3,11 @@ import styles from "./Filter.module.css"; import { useRef } from "react"; import { useSearchParams, useRouter } from "next/navigation"; -import { Category, Badge } from "@/badgehub-api-client/generated/models"; +import { Category, Device } from "@/badgehub-api-client/generated/models"; type FilterProps = { categories: Category[]; - devices: Badge[]; + devices: Device[]; }; export function Filter({ categories, devices }: FilterProps) { diff --git a/src/components/MainNav/index.tsx b/src/components/MainNav/index.tsx index 704454c..e4e0044 100644 --- a/src/components/MainNav/index.tsx +++ b/src/components/MainNav/index.tsx @@ -7,8 +7,6 @@ import clsx from "clsx"; export function MainNav() { const pathname = usePathname(); - console.log("pathname", pathname); - return (