fix(frontend): SSR of create.vue working, add .vscode launch.json, fix launch.json bug due to typescript in nuxt.config.ts
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -51,9 +51,6 @@ bin/
|
|||||||
!**/src/main/**/bin/
|
!**/src/main/**/bin/
|
||||||
!**/src/test/**/bin/
|
!**/src/test/**/bin/
|
||||||
|
|
||||||
### VS Code ###
|
|
||||||
.vscode/
|
|
||||||
|
|
||||||
### Kotlin ###
|
### Kotlin ###
|
||||||
.kotlin
|
.kotlin
|
||||||
|
|
||||||
|
|||||||
28
.vscode/launch.json
vendored
Normal file
28
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "chrome",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "client: chrome",
|
||||||
|
"url": "http://localhost:3000",
|
||||||
|
"webRoot": "${workspaceFolder}/legalconsenthub"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"request": "launch",
|
||||||
|
"name": "server: nuxt",
|
||||||
|
"outputCapture": "std",
|
||||||
|
"cwd": "${workspaceFolder}/legalconsenthub",
|
||||||
|
"type": "node-terminal",
|
||||||
|
"command": "npm run dev"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"compounds": [
|
||||||
|
{
|
||||||
|
"name": "fullstack: nuxt",
|
||||||
|
"configurations": ["server: nuxt", "client: chrome"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"java.compile.nullAnalysis.mode": "automatic"
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-for="(formElement, index) in props.modelValue" :key="formElement.id">
|
<div v-for="formElement in props.modelValue" :key="formElement.id">
|
||||||
<component
|
<component
|
||||||
:is="getResolvedComponent(formElement)"
|
:is="getResolvedComponent(formElement)"
|
||||||
:form-options="formElement.options"
|
:form-options="formElement.options"
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
import type { CreateApplicationFormDto, ApplicationFormDto, PagedApplicationFormDto } from '~/.api-client'
|
import {
|
||||||
|
type CreateApplicationFormDto,
|
||||||
|
type ApplicationFormDto,
|
||||||
|
type PagedApplicationFormDto,
|
||||||
|
ResponseError
|
||||||
|
} from '~/.api-client'
|
||||||
|
|
||||||
const currentApplicationForm: Ref<ApplicationFormDto | undefined> = ref()
|
const currentApplicationForm: Ref<ApplicationFormDto | undefined> = ref()
|
||||||
|
|
||||||
@@ -11,8 +16,12 @@ export function useApplicationForm() {
|
|||||||
try {
|
try {
|
||||||
currentApplicationForm.value = await applicationFormApi.createApplicationForm(createApplicationFormDto)
|
currentApplicationForm.value = await applicationFormApi.createApplicationForm(createApplicationFormDto)
|
||||||
return currentApplicationForm.value
|
return currentApplicationForm.value
|
||||||
} catch (e) {
|
} catch (e: unknown) {
|
||||||
console.error('Failed creating application form', e)
|
if (e instanceof ResponseError) {
|
||||||
|
console.error('Failed creating application form:', e.response)
|
||||||
|
} else {
|
||||||
|
console.error('Failed creating application form:', e)
|
||||||
|
}
|
||||||
return Promise.reject(e)
|
return Promise.reject(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,8 +29,12 @@ export function useApplicationForm() {
|
|||||||
async function getAllApplicationForms(): Promise<PagedApplicationFormDto> {
|
async function getAllApplicationForms(): Promise<PagedApplicationFormDto> {
|
||||||
try {
|
try {
|
||||||
return await applicationFormApi.getAllApplicationForms()
|
return await applicationFormApi.getAllApplicationForms()
|
||||||
} catch (e) {
|
} catch (e: unknown) {
|
||||||
console.error('Failed retrieving application forms', e)
|
if (e instanceof ResponseError) {
|
||||||
|
console.error('Failed retrieving application forms:', e.response)
|
||||||
|
} else {
|
||||||
|
console.error('Failed retrieving application forms:', e)
|
||||||
|
}
|
||||||
return Promise.reject(e)
|
return Promise.reject(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,8 +42,12 @@ export function useApplicationForm() {
|
|||||||
async function getApplicationFormById(id: string): Promise<ApplicationFormDto> {
|
async function getApplicationFormById(id: string): Promise<ApplicationFormDto> {
|
||||||
try {
|
try {
|
||||||
return await applicationFormApi.getApplicationFormById(id)
|
return await applicationFormApi.getApplicationFormById(id)
|
||||||
} catch (e) {
|
} catch (e: unknown) {
|
||||||
console.error(`Failed retrieving application form with ID ${id}`, e)
|
if (e instanceof ResponseError) {
|
||||||
|
console.error(`Failed retrieving application form with ID ${id}:`, e.response)
|
||||||
|
} else {
|
||||||
|
console.error(`Failed retrieving application form with ID ${id}:`, e)
|
||||||
|
}
|
||||||
return Promise.reject(e)
|
return Promise.reject(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -42,8 +59,12 @@ export function useApplicationForm() {
|
|||||||
try {
|
try {
|
||||||
currentApplicationForm.value = await applicationFormApi.updateApplicationForm(id, applicationFormDto)
|
currentApplicationForm.value = await applicationFormApi.updateApplicationForm(id, applicationFormDto)
|
||||||
return currentApplicationForm.value
|
return currentApplicationForm.value
|
||||||
} catch (e) {
|
} catch (e: unknown) {
|
||||||
console.error(`Failed deleting application form with ID ${id}`, e)
|
if (e instanceof ResponseError) {
|
||||||
|
console.error(`Failed updating application form with ID ${id}:`, e.response)
|
||||||
|
} else {
|
||||||
|
console.error(`Failed updating application form with ID ${id}:`, e)
|
||||||
|
}
|
||||||
return Promise.reject(e)
|
return Promise.reject(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -51,8 +72,12 @@ export function useApplicationForm() {
|
|||||||
async function deleteApplicationFormById(id: string): Promise<void> {
|
async function deleteApplicationFormById(id: string): Promise<void> {
|
||||||
try {
|
try {
|
||||||
return await applicationFormApi.deleteApplicationFormById(id)
|
return await applicationFormApi.deleteApplicationFormById(id)
|
||||||
} catch (e) {
|
} catch (e: unknown) {
|
||||||
console.error(`Failed deleting application form with ID ${id}`, e)
|
if (e instanceof ResponseError) {
|
||||||
|
console.error(`Failed deleting application form with ID ${id}:`, e.response)
|
||||||
|
} else {
|
||||||
|
console.error(`Failed deleting application form with ID ${id}:`, e)
|
||||||
|
}
|
||||||
return Promise.reject(e)
|
return Promise.reject(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { ApplicationFormApi, Configuration } from '../.api-client'
|
import { ApplicationFormApi, Configuration } from '../.api-client'
|
||||||
import type { CreateApplicationFormDto, ApplicationFormDto, PagedApplicationFormDto } from '~/.api-client'
|
import type { CreateApplicationFormDto, ApplicationFormDto, PagedApplicationFormDto } from '~/.api-client'
|
||||||
import { cleanDoubleSlashes } from 'ufo'
|
import { cleanDoubleSlashes, withoutTrailingSlash } from 'ufo'
|
||||||
|
|
||||||
export function useApplicationFormApi() {
|
export function useApplicationFormApi() {
|
||||||
const appBaseUrl = useRuntimeConfig().app.baseURL
|
const appBaseUrl = useRuntimeConfig().app.baseURL
|
||||||
const { serverApiBaseUrl, serverApiBasePath, clientProxyBasePath } = useRuntimeConfig().public
|
const { serverApiBaseUrl, serverApiBasePath, clientProxyBasePath } = useRuntimeConfig().public
|
||||||
|
|
||||||
const basePath = cleanDoubleSlashes(
|
const basePath = withoutTrailingSlash(
|
||||||
import.meta.client ? appBaseUrl + clientProxyBasePath : serverApiBaseUrl + serverApiBasePath
|
cleanDoubleSlashes(import.meta.client ? appBaseUrl + clientProxyBasePath : serverApiBaseUrl + serverApiBasePath)
|
||||||
)
|
)
|
||||||
|
|
||||||
const applicationFormApiClient = new ApplicationFormApi(new Configuration({ basePath }))
|
const applicationFormApiClient = new ApplicationFormApi(new Configuration({ basePath }))
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ export default defineNuxtConfig({
|
|||||||
pathPrefix: false
|
pathPrefix: false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
typescript: {
|
// typescript: {
|
||||||
typeCheck: true
|
// typeCheck: true
|
||||||
},
|
// },
|
||||||
devtools: { enabled: true },
|
devtools: { enabled: true },
|
||||||
compatibilityDate: '2024-11-01'
|
compatibilityDate: '2024-11-01'
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user