Skip to content

Commit

Permalink
Fix crash on content create when assigning references (#4961)
Browse files Browse the repository at this point in the history
* Fix crash on content create when assigning references

* Changeset
  • Loading branch information
Droniu committed Jun 14, 2024
1 parent 6e27ae5 commit a781c90
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/soft-crabs-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Dashboard no longer crashes when assigning reference attribute while creating content.
5 changes: 4 additions & 1 deletion src/pages/views/PageCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export const PageCreate: React.FC<PageCreateProps> = ({ params }) => {
const handleAssignAttributeReferenceClick = (attribute: AttributeInput) =>
navigate(
pageCreateUrl({
...params,
action: "assign-attribute-value",
id: attribute.id,
}),
Expand Down Expand Up @@ -227,7 +228,9 @@ export const PageCreate: React.FC<PageCreateProps> = ({ params }) => {
fetchMoreReferenceProducts={fetchMoreReferenceProducts}
fetchAttributeValues={searchAttributeValues}
fetchMoreAttributeValues={fetchMoreAttributeValues}
onCloseDialog={() => navigate(pageCreateUrl())}
onCloseDialog={() =>
navigate(pageCreateUrl({ "page-type-id": params["page-type-id"] }))
}
selectedPageType={selectedPageType?.pageType}
onSelectPageType={handleSelectPageTypeId}
onAttributeSelectBlur={searchAttributeReset}
Expand Down

0 comments on commit a781c90

Please sign in to comment.