Merge branch 'main' into test-text-area-input

This commit is contained in:
Moriz Wahl 2025-02-25 11:04:33 +01:00 committed by GitHub
commit bf7ab08772
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 4 deletions

View File

@ -40,6 +40,7 @@ export default [
}),
typescript({
tsconfig: './tsconfig.json',
noEmitOnError: true,
}),
svg({ base64: true }),
],

View File

@ -53,6 +53,13 @@ export function ItemFormPopup(props: ItemFormPopupProps) {
})
formItem.position = { type: 'Point', coordinates: [props.position.lng, props.position.lat] }
evt.preventDefault()
const name = formItem.name ? formItem.name : user?.first_name
if (!name) {
toast.error('Name is must be defined')
return
}
setSpinner(true)
formItem.text &&
@ -98,8 +105,8 @@ export function ItemFormPopup(props: ItemFormPopupProps) {
;(!props.layer.userProfileLayer || !item) &&
(await props.layer.api?.createItem!({
...formItem,
name,
id: uuid,
name: formItem.name ? formItem.name : user?.first_name,
}))
success = true
// eslint-disable-next-line no-catch-all/no-catch-all

View File

@ -82,7 +82,6 @@ function useItemsManager(initialItems: Item[]): {
},
})
result.map((item) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
dispatch({ type: 'ADD', item: { ...item, layer } })
return null
})

View File

@ -18,8 +18,7 @@ export interface LayerProps {
markerShape: string
markerDefaultColor: string
markerDefaultColor2?: string
// eslint-disable-next-line @typescript-eslint/no-explicit-any
api?: ItemsApi<any>
api?: ItemsApi<Item>
itemType: ItemType
userProfileLayer?: boolean
customEditLink?: string