From 84966d37ed257cbf4734f2702d5af9bce57c4ee4 Mon Sep 17 00:00:00 2001 From: Harish Mohan Raj Date: Tue, 16 Apr 2024 23:56:37 +0530 Subject: [PATCH] WIP --- app/main.wasp | 4 ++++ app/src/client/App.tsx | 1 - app/src/client/app/ModelsPage.tsx | 39 ++++++++++++++++++++++++++++++- app/src/server/actions.ts | 33 +++++++++++++++++++++++++- 4 files changed, 74 insertions(+), 3 deletions(-) diff --git a/app/main.wasp b/app/main.wasp index e7f2d79..8b49a08 100644 --- a/app/main.wasp +++ b/app/main.wasp @@ -265,6 +265,10 @@ action updateUserById { entities: [User] } +action getModels { + fn: import { getModels } from "@src/server/actions.js", + entities: [] +} // 📚 Queries diff --git a/app/src/client/App.tsx b/app/src/client/App.tsx index 8832eb2..c0f3a56 100644 --- a/app/src/client/App.tsx +++ b/app/src/client/App.tsx @@ -59,7 +59,6 @@ export default function App({ children }: { children: ReactNode }) { useEffect(() => { if (user) { - console.log('user', user); if (!user.isSignUpComplete) { if (user.hasAcceptedTos) { updateCurrentUser({ diff --git a/app/src/client/app/ModelsPage.tsx b/app/src/client/app/ModelsPage.tsx index ab52b38..1346868 100644 --- a/app/src/client/app/ModelsPage.tsx +++ b/app/src/client/app/ModelsPage.tsx @@ -1,7 +1,43 @@ +import { useState } from 'react'; import CustomLayout from './layout/CustomLayout'; import CustomBreadcrumb from '../components/CustomBreadcrumb'; +import Button from '../components/Button'; +import { getModels } from 'wasp/client/operations'; + +interface JsonSchemaProperty { + default?: string; + description: string; + enum?: string[]; + title: string; + type: string; + const?: string; + format?: string; + maxLength?: number; + minLength?: number; +} + +interface JsonSchema { + properties: Record; + required: string[]; + title: string; + type: string; +} + +interface Schema { + name: string; + json_schema: JsonSchema; +} + +interface ModelSchema { + schemas: Schema[]; +} const ModelsPage = () => { + const [modelsSchema, setModelsSchema] = useState(null); + const logout = async () => { + const response = await getModels(); + setModelsSchema(response); + }; return ( @@ -12,7 +48,8 @@ const ModelsPage = () => { className='flex-col flex items-start justify-between p-6 gap-3 w-full' style={{ width: '1000px', height: '600px' }} > - Some content goes here... +