fix(frontend): fixed gallery object on item update (#261)

* fixed gallery object on item update

* version
This commit is contained in:
Anton Tranelis 2025-06-18 13:19:01 +02:00 committed by GitHub
parent d73e4886e8
commit 1828f29cfb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 954 additions and 196 deletions

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@
"react-dom": "^18.2.0",
"react-rnd": "^10.4.1",
"react-router-dom": "^6.23.0",
"utopia-ui": "^3.0.96"
"utopia-ui": "^3.0.105"
},
"devDependencies": {
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",

View File

@ -230,7 +230,6 @@ function App() {
path={l.name}
element={
<OverlayItemsIndexPage
plusButton={l.index_plus_button}
layerName={l.name}
url={'/item/'}
parameterField={'id'}

4
lib/package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "utopia-ui",
"version": "3.0.99",
"version": "3.0.105",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "utopia-ui",
"version": "3.0.99",
"version": "3.0.105",
"license": "GPL-3.0-only",
"dependencies": {
"@heroicons/react": "^2.0.17",

View File

@ -1,6 +1,6 @@
{
"name": "utopia-ui",
"version": "3.0.99",
"version": "3.0.105",
"description": "Reuseable React Components to build mapping apps for real life communities and networks",
"repository": "https://github.com/utopia-os/utopia-ui",
"homepage": "https://utopia-os.org/",

View File

@ -199,7 +199,9 @@ export const onUpdateItem = async (
...(state.offers.length > 0 && { offers: offerUpdates }),
...(state.needs.length > 0 && { needs: needsUpdates }),
...(state.openCollectiveSlug && { openCollectiveSlug: state.openCollectiveSlug }),
gallery: state.gallery,
gallery: state.gallery.map((i) => ({
directus_files_id: i.directus_files_id.id,
})),
}
const offersState: any[] = []
@ -249,7 +251,16 @@ export const onUpdateItem = async (
},
})
.catch(setLoading(false))
.then(() => item && updateItem({ ...item, ...changedItem, markerIcon: state.marker_icon }))
.then(
() =>
item &&
updateItem({
...item,
...changedItem,
markerIcon: state.marker_icon,
gallery: state.gallery,
}),
)
.then(() => {
setLoading(false)
navigate(`/item/${item.id}${params && '?' + params}`)