feat(fullstack): Add test application form creation

This commit is contained in:
2026-01-31 08:58:35 +01:00
parent 954c6d00e1
commit b279e6cc17
8 changed files with 326 additions and 14 deletions

View File

@@ -0,0 +1,24 @@
import { TestDataApi, Configuration, type ApplicationFormDto } from '~~/.api-client'
import { cleanDoubleSlashes, withoutTrailingSlash } from 'ufo'
import { wrappedFetchWrap } from '~/utils/wrappedFetch'
export function useTestDataApi() {
const appBaseUrl = useRuntimeConfig().app.baseURL
const { serverApiBasePath, clientProxyBasePath } = useRuntimeConfig().public
const basePath = withoutTrailingSlash(
cleanDoubleSlashes(import.meta.client ? appBaseUrl + clientProxyBasePath : clientProxyBasePath + serverApiBasePath)
)
const testDataApiClient = new TestDataApi(
new Configuration({ basePath, fetchApi: wrappedFetchWrap(useRequestFetch()) })
)
async function createTestDataApplicationForm(organizationId: string): Promise<ApplicationFormDto> {
return testDataApiClient.createTestDataApplicationForm({ organizationId })
}
return {
createTestDataApplicationForm
}
}