diff --git a/frontend/src/lib/client/schemas.gen.ts b/frontend/src/lib/client/schemas.gen.ts index 31d4036..71d9082 100644 --- a/frontend/src/lib/client/schemas.gen.ts +++ b/frontend/src/lib/client/schemas.gen.ts @@ -623,6 +623,31 @@ export const MilestoneTextPublicSchema = { title: 'MilestoneTextPublic' } as const; +export const UserAnswerPublicSchema = { + properties: { + id: { + type: 'integer', + title: 'Id' + }, + user_question_id: { + type: 'integer', + title: 'User Question Id' + }, + answer: { + type: 'string', + title: 'Answer' + } + }, + type: 'object', + required: ['id', 'user_question_id', 'answer'], + title: 'UserAnswerPublic', + description: `External data model for UserAnswers + +Parameters +---------- +SQLModel : Pydantic model basic sqlmodel pydantic type` +} as const; + export const UserCreateSchema = { properties: { email: { diff --git a/frontend/src/lib/client/services.gen.ts b/frontend/src/lib/client/services.gen.ts index b307ca6..4e4ae70 100644 --- a/frontend/src/lib/client/services.gen.ts +++ b/frontend/src/lib/client/services.gen.ts @@ -103,6 +103,11 @@ import type { UpdateMilestoneAnswerData, UpdateMilestoneAnswerError, UpdateMilestoneAnswerResponse, + GetCurrentUserAnswersError, + GetCurrentUserAnswersResponse, + UpdateCurrentUserAnswersData, + UpdateCurrentUserAnswersError, + UpdateCurrentUserAnswersResponse, AuthCookieLoginData, AuthCookieLoginError, AuthCookieLoginResponse, @@ -664,6 +669,38 @@ export const updateMilestoneAnswer = ( }); }; +/** + * Get Current User Answers + */ +export const getCurrentUserAnswers = ( + options?: Options +) => { + return (options?.client ?? client).get< + GetCurrentUserAnswersResponse, + GetCurrentUserAnswersError, + ThrowOnError + >({ + ...options, + url: '/users/user-answers/{user_id}' + }); +}; + +/** + * Update Current User Answers + */ +export const updateCurrentUserAnswers = ( + options: Options +) => { + return (options?.client ?? client).put< + UpdateCurrentUserAnswersResponse, + UpdateCurrentUserAnswersError, + ThrowOnError + >({ + ...options, + url: '/usersuser_answers/{user_id}' + }); +}; + /** * Auth:Cookie.Login */ diff --git a/frontend/src/lib/client/types.gen.ts b/frontend/src/lib/client/types.gen.ts index 5982f12..009e051 100644 --- a/frontend/src/lib/client/types.gen.ts +++ b/frontend/src/lib/client/types.gen.ts @@ -162,6 +162,19 @@ export type MilestoneTextPublic = { help?: string; }; +/** + * External data model for UserAnswers + * + * Parameters + * ---------- + * SQLModel : Pydantic model basic sqlmodel pydantic type + */ +export type UserAnswerPublic = { + id: number; + user_question_id: number; + answer: string; +}; + export type UserCreate = { email: string; password: string; @@ -514,6 +527,21 @@ export type UpdateMilestoneAnswerResponse = MilestoneAnswerPublic; export type UpdateMilestoneAnswerError = HTTPValidationError; +export type GetCurrentUserAnswersResponse = UserAnswerPublic; + +export type GetCurrentUserAnswersError = unknown; + +export type UpdateCurrentUserAnswersData = { + body: UserAnswerPublic; + query: { + milestone_answer_session_id: number; + }; +}; + +export type UpdateCurrentUserAnswersResponse = unknown; + +export type UpdateCurrentUserAnswersError = HTTPValidationError; + export type AuthCookieLoginData = { body: Body_auth_cookie_login_auth_login_post; }; diff --git a/frontend/src/lib/components/UserDataInput.svelte b/frontend/src/lib/components/UserDataInput.svelte index a794b40..7a00d4e 100644 --- a/frontend/src/lib/components/UserDataInput.svelte +++ b/frontend/src/lib/components/UserDataInput.svelte @@ -1,10 +1,16 @@