Commit 4d1c01ad authored by Nick Kipling's avatar Nick Kipling

Small change to request action

parent 90db8029
......@@ -29,15 +29,13 @@ export const requestPackagesList = ({ dispatch, state }, params = {}) => {
const { sort, orderBy } = state.sorting;
const type = state.selectedType?.type?.toLowerCase();
const packageType = { package_type: type };
const nameFilter = state.filterQuery?.toLowerCase();
const packageName = { package_name: nameFilter };
const packageFilters = { package_type: type, package_name: nameFilter };
const apiMethod = state.config.isGroupPage ? 'groupPackages' : 'projectPackages';
return Api[apiMethod](state.config.resourceId, {
params: { page, per_page, sort, order_by: orderBy, ...packageType, ...packageName },
params: { page, per_page, sort, order_by: orderBy, ...packageFilters },
})
.then(({ data, headers }) => {
dispatch('receivePackagesListSuccess', { data, headers });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment