Skip to content

Commit

Permalink
Repository collection versions - fix "Cannot read properties of undef…
Browse files Browse the repository at this point in the history
…ined" after removing cv (#4416) (#4420)

go to a Repository Collection versions tab,
remove a collection version

removal succeeds, but produces an extra error because we're calling the reload query wrong .. fixing

(ts-ignored to prevent TS2525: Initializer provides no value for this binding element and the binding element has no default value.)

Related to AAP-16936
No-Issue

(cherry picked from commit 8b3ca60)

Co-authored-by: Martin Hradil <[email protected]>
  • Loading branch information
patchback[bot] and himdel authored Oct 17, 2023
1 parent 429d86d commit 8e2edb9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/actions/ansible-repository-collection-version-add.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ const AddCollectionVersionModal = ({
setAlerts([...alerts, alert]);
};

const query = ({ params }) => {
// @ts-expect-error: TS2525: Initializer provides no value for this binding element and the binding element has no default value.
const query = ({ params } = {}) => {
const newParams = { ...params };
newParams.ordering = newParams.sort;
delete newParams.sort;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export const CollectionVersionsTab = ({
item,
actionContext: { addAlert, hasPermission },
}: TabProps) => {
const query = ({ params }) => {
// @ts-expect-error: TS2525: Initializer provides no value for this binding element and the binding element has no default value.
const query = ({ params } = {}) => {
const newParams = { ...params };
newParams.ordering = newParams.sort;
delete newParams.sort;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ const VersionContent = ({
}

const API = AnyAPI(href);
const query = ({ params }) => API.list(params);
// @ts-expect-error: TS2525: Initializer provides no value for this binding element and the binding element has no default value.
const query = ({ params } = {}) => API.list(params);
const renderTableRow = ({
manifest: {
collection_info: { namespace, name, version },
Expand Down

0 comments on commit 8e2edb9

Please sign in to comment.