mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
fix(frontend): fixed gallery object on item update (#261)
* fixed gallery object on item update * version
This commit is contained in:
parent
d73e4886e8
commit
1828f29cfb
1126
frontend/package-lock.json
generated
1126
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -20,7 +20,7 @@
|
|||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-rnd": "^10.4.1",
|
"react-rnd": "^10.4.1",
|
||||||
"react-router-dom": "^6.23.0",
|
"react-router-dom": "^6.23.0",
|
||||||
"utopia-ui": "^3.0.96"
|
"utopia-ui": "^3.0.105"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
||||||
|
|||||||
@ -230,7 +230,6 @@ function App() {
|
|||||||
path={l.name}
|
path={l.name}
|
||||||
element={
|
element={
|
||||||
<OverlayItemsIndexPage
|
<OverlayItemsIndexPage
|
||||||
plusButton={l.index_plus_button}
|
|
||||||
layerName={l.name}
|
layerName={l.name}
|
||||||
url={'/item/'}
|
url={'/item/'}
|
||||||
parameterField={'id'}
|
parameterField={'id'}
|
||||||
|
|||||||
4
lib/package-lock.json
generated
4
lib/package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "utopia-ui",
|
"name": "utopia-ui",
|
||||||
"version": "3.0.99",
|
"version": "3.0.105",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "utopia-ui",
|
"name": "utopia-ui",
|
||||||
"version": "3.0.99",
|
"version": "3.0.105",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@heroicons/react": "^2.0.17",
|
"@heroicons/react": "^2.0.17",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "utopia-ui",
|
"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",
|
"description": "Reuseable React Components to build mapping apps for real life communities and networks",
|
||||||
"repository": "https://github.com/utopia-os/utopia-ui",
|
"repository": "https://github.com/utopia-os/utopia-ui",
|
||||||
"homepage": "https://utopia-os.org/",
|
"homepage": "https://utopia-os.org/",
|
||||||
|
|||||||
@ -199,7 +199,9 @@ export const onUpdateItem = async (
|
|||||||
...(state.offers.length > 0 && { offers: offerUpdates }),
|
...(state.offers.length > 0 && { offers: offerUpdates }),
|
||||||
...(state.needs.length > 0 && { needs: needsUpdates }),
|
...(state.needs.length > 0 && { needs: needsUpdates }),
|
||||||
...(state.openCollectiveSlug && { openCollectiveSlug: state.openCollectiveSlug }),
|
...(state.openCollectiveSlug && { openCollectiveSlug: state.openCollectiveSlug }),
|
||||||
gallery: state.gallery,
|
gallery: state.gallery.map((i) => ({
|
||||||
|
directus_files_id: i.directus_files_id.id,
|
||||||
|
})),
|
||||||
}
|
}
|
||||||
|
|
||||||
const offersState: any[] = []
|
const offersState: any[] = []
|
||||||
@ -249,7 +251,16 @@ export const onUpdateItem = async (
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
.catch(setLoading(false))
|
.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(() => {
|
.then(() => {
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
navigate(`/item/${item.id}${params && '?' + params}`)
|
navigate(`/item/${item.id}${params && '?' + params}`)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user