Skip to content

Commit

Permalink
Redux: Add RTK Query + /provisioning/v1/sources endpoint
Browse files Browse the repository at this point in the history
This commit adds the /provisioning/v1/sources endpoint via a new
apiSlice.js which uses RTK Query's createApi method.

RTK Query allows us to query the /provisioning/v1/sources endpoint using an
automatically generated React hook, `useGetSourcesQuery`. The usage is
something like this (from within a React component):
`const { data: sources, isLoading, isSuccess, isError, error } =
useGetSourcesQuery()`.

This will make it much easier for us to manage data caching and just as
importantly manage loading and error states properly.

Future PRs will migrate data fetching in the other slices (clones, composes,
repositories) to the apiSlice.

For more info on RTK Query, see:
https://redux.js.org/tutorials/essentials/part-7-rtk-query-basics
  • Loading branch information
Travis CI User committed Jan 26, 2023
1 parent 58669ce commit 7a1a669
Show file tree
Hide file tree
Showing 74 changed files with 75 additions and 75 deletions.
6 changes: 3 additions & 3 deletions app.info.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"app_name": "image-builder",
"node_version": ">=16.0.0",
"src_hash": "1fa0466676a4c381ae8f2575187b7810fd71aec1",
"src_hash": "d4eb5f78f03f3d3857d1f0e2e043ba665ec6a31c",
"src_tag": "",
"src_branch": "stage-stable",
"patternfly_dependencies": ["@patternfly/patternfly@4.210.2","@patternfly/react-core@4.267.6","@patternfly/react-table@4.112.6"],
"rh_cloud_services_dependencies": ["@redhat-cloud-services/frontend-components-notifications@3.2.12","@redhat-cloud-services/frontend-components-utilities@3.3.11","@redhat-cloud-services/frontend-components@3.9.25"],
"travis": {
"event_type": "push",
"build_number": "3061",
"build_web_url": "https://app.travis-ci.com/RedHatInsights/image-builder-frontend/builds/260023148"
"build_number": "3067",
"build_web_url": "https://app.travis-ci.com/RedHatInsights/image-builder-frontend/builds/260050256"
}
}
File renamed without changes.
4 changes: 2 additions & 2 deletions fed-mods.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"image_builder": {
"entry": [
"/apps/image-builder/image_builder.1674659878248.046b606feb8ccba2794c.js"
"/apps/image-builder/image_builder.1674727412349.085c6b3abc7e7817e2aa.js"
],
"modules": [
"/apps/image-builder/js/412.1674659878162.046b606feb8ccba2794c.js"
"/apps/image-builder/js/412.1674727412265.085c6b3abc7e7817e2aa.js"
]
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions js/332.1674659878162.046b606feb8ccba2794c.js

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions js/409.1674727412265.085c6b3abc7e7817e2aa.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions js/412.1674659878162.046b606feb8ccba2794c.js

This file was deleted.

2 changes: 2 additions & 0 deletions js/412.1674727412265.085c6b3abc7e7817e2aa.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Loading

0 comments on commit 7a1a669

Please sign in to comment.