chore: fix app build errors
All checks were successful
Build and Push Docker Image / tests (push) Successful in 43s
Build and Push Docker Image / build (push) Successful in 4m7s

This commit is contained in:
Lars Hampe 2024-10-24 23:41:38 +02:00
parent fb2e1eee17
commit dbef7867ca
3 changed files with 15 additions and 11 deletions

View File

@ -112,13 +112,16 @@ const Component = () => {
!field.value && 'text-muted-foreground',
)}
>
{field.value.length === 1 &&
{field?.value?.length === 1 &&
changelogList.data?.find((changelog) =>
field.value?.includes(changelog.id),
)?.title}
{field.value.length <= 0 && 'No changelog selected'}
{field.value.length > 1 &&
`${field.value.length} selected`}
{field?.value &&
field.value.length <= 0 &&
'No changelog selected'}
{field?.value &&
field.value.length > 1 &&
`${field?.value?.length} selected`}
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
</Button>
</FormControl>
@ -135,14 +138,16 @@ const Component = () => {
key={changelog.id}
onSelect={() => {
const getIds = () => {
if (field.value.includes(changelog.id)) {
const asd = field.value.filter(
if (field.value?.includes(changelog.id)) {
return field.value.filter(
(id) => id !== changelog.id,
)
return asd
}
return [...field.value, changelog.id]
return [
...(field?.value as string[]),
changelog.id,
]
}
form.setValue('changelogIds', getIds())
}}
@ -150,7 +155,7 @@ const Component = () => {
<Check
className={cn(
'mr-2 h-4 w-4',
field.value.includes(changelog.id)
field.value?.includes(changelog.id)
? 'opacity-100'
: 'opacity-0',
)}

View File

@ -6,7 +6,7 @@ import {
CardTitle,
} from '@boring.tools/ui'
import { Link, createLazyFileRoute } from '@tanstack/react-router'
import { CircleMinusIcon, PlusCircleIcon } from 'lucide-react'
import { CircleMinusIcon } from 'lucide-react'
import { usePageById, usePageUpdate } from '../hooks/usePage'
const Component = () => {

View File

@ -1,6 +1,5 @@
import { z } from '@hono/zod-openapi'
import { PageOutput } from './base'
import { PageCreateInput } from './create'
export const PageUpdateOutput = PageOutput
export const PageUpdateInput = z