mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 23:51:09 +03:00
add defaults to qs instead of passing as additional params to api request
This commit is contained in:
parent
e080c1f4c2
commit
9a891794d9
@ -23,17 +23,19 @@ import {
|
||||
WorkflowJobsAPI,
|
||||
} from '@api';
|
||||
|
||||
const QS_CONFIG = getQSConfig(
|
||||
function JobList({ i18n, defaultParams, showTypeColumn = false }) {
|
||||
const QS_CONFIG = getQSConfig(
|
||||
'job',
|
||||
{
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
order_by: '-finished',
|
||||
not__launch_type: 'sync',
|
||||
...defaultParams,
|
||||
},
|
||||
['page', 'page_size']
|
||||
);
|
||||
);
|
||||
|
||||
function JobList({ i18n, defaultParams, showTypeColumn = false }) {
|
||||
const [selected, setSelected] = useState([]);
|
||||
const location = useLocation();
|
||||
|
||||
@ -48,7 +50,7 @@ function JobList({ i18n, defaultParams, showTypeColumn = false }) {
|
||||
|
||||
const {
|
||||
data: { count, results },
|
||||
} = await UnifiedJobsAPI.read({ ...params, ...defaultParams });
|
||||
} = await UnifiedJobsAPI.read({ ...params });
|
||||
|
||||
return {
|
||||
itemCount: count,
|
||||
|
@ -53,10 +53,7 @@ function Jobs({ i18n }) {
|
||||
<Switch>
|
||||
<Route exact path={match.path}>
|
||||
<PageSection>
|
||||
<JobList
|
||||
showTypeColumn
|
||||
defaultParams={{ not__launch_type: 'sync' }}
|
||||
/>
|
||||
<JobList showTypeColumn />
|
||||
</PageSection>
|
||||
</Route>
|
||||
<Route path={`${match.path}/:id/details`}>
|
||||
|
Loading…
Reference in New Issue
Block a user