feat: filter flows by appKey in app flows
This commit is contained in:
@@ -4,8 +4,13 @@ import { GET_FLOWS } from 'graphql/queries/get-flows';
|
||||
import AppFlowRow from 'components/AppFlowRow';
|
||||
import type { IFlow } from '@automatisch/types';
|
||||
|
||||
export default function AppFlows(): React.ReactElement {
|
||||
const { data } = useQuery(GET_FLOWS);
|
||||
type AppFlowsProps = {
|
||||
appKey: string;
|
||||
}
|
||||
|
||||
export default function AppFlows(props: AppFlowsProps): React.ReactElement {
|
||||
const { appKey } = props;
|
||||
const { data } = useQuery(GET_FLOWS, { variables: { appKey }});
|
||||
const appFlows: IFlow[] = data?.getFlows || [];
|
||||
|
||||
return (
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const GET_FLOWS = gql`
|
||||
query GetFlows {
|
||||
getFlows {
|
||||
query GetFlows($appKey: String) {
|
||||
getFlows(appKey: $appKey) {
|
||||
id
|
||||
name
|
||||
}
|
||||
|
@@ -155,7 +155,7 @@ export default function Application(): React.ReactElement {
|
||||
</Box>
|
||||
|
||||
<Routes>
|
||||
<Route path={`${URLS.FLOWS}/*`} element={<AppFlows />} />
|
||||
<Route path={`${URLS.FLOWS}/*`} element={<AppFlows appKey={appKey} />} />
|
||||
|
||||
<Route path={`${URLS.CONNECTIONS}/*`} element={<AppConnections appKey={appKey} />} />
|
||||
|
||||
|
Reference in New Issue
Block a user