-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
store/backendApi: export the relevant store api
Since the implementation of the cockpitApi and imageBuilderApi are different, we should make sure to export the correct one depending on the environment we are in.
- Loading branch information
1 parent
a6359ce
commit 3fc7ddc
Showing
5 changed files
with
29 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
import { useGetBlueprintsQuery as useCockpitGetBlueprintsQuery } from './cockpitApi'; | ||
import { useGetBlueprintsQuery as useImageBuilderGetBlueprintsQuery } from './imageBuilderApi'; | ||
import { | ||
useGetBlueprintsQuery as useCockpitGetBlueprintsQuery, | ||
useDeleteBlueprintMutation as useCockpitDeleteMutation, | ||
} from './cockpitApi'; | ||
import { cockpitApi } from './enhancedCockpitApi'; | ||
import { imageBuilderApi } from './enhancedImageBuilderApi'; | ||
import { | ||
useGetBlueprintsQuery as useImageBuilderGetBlueprintsQuery, | ||
useDeleteBlueprintMutation as useImageBuilderDeleteMutation, | ||
} from './imageBuilderApi'; | ||
|
||
export const useGetBlueprintsQuery = process.env.IS_ON_PREMISE | ||
? useCockpitGetBlueprintsQuery | ||
: useImageBuilderGetBlueprintsQuery; | ||
|
||
export const useDeleteBlueprintMutation = process.env.IS_ON_PREMISE | ||
? useCockpitDeleteMutation | ||
: useImageBuilderDeleteMutation; | ||
|
||
export const backendApi = process.env.IS_ON_PREMISE | ||
? cockpitApi | ||
: imageBuilderApi; |