attempt query get

This commit is contained in:
ronronscelestes 2021-11-05 11:55:00 +01:00
parent c921626baf
commit 1ed526fe23
3 changed files with 5 additions and 2 deletions

View File

@ -59,6 +59,7 @@ export const BrowseStep = ({
onChange={e => onChangeSearch(e.target.value)} onChange={e => onChangeSearch(e.target.value)}
clearLabel="Clearing the asset search" clearLabel="Clearing the asset search"
size="S" size="S"
value={queryObject._q}
> >
Searching for an asset Searching for an asset
</Searchbar> </Searchbar>
@ -105,6 +106,7 @@ BrowseStep.propTypes = {
queryObject: PropTypes.shape({ queryObject: PropTypes.shape({
page: PropTypes.number.isRequired, page: PropTypes.number.isRequired,
pageSize: PropTypes.number.isRequired, pageSize: PropTypes.number.isRequired,
_q: PropTypes.string.isRequired,
}).isRequired, }).isRequired,
pagination: PropTypes.shape({ pageCount: PropTypes.number.isRequired }).isRequired, pagination: PropTypes.shape({ pageCount: PropTypes.number.isRequired }).isRequired,
selectedAssets: PropTypes.arrayOf(PropTypes.shape({})).isRequired, selectedAssets: PropTypes.arrayOf(PropTypes.shape({})).isRequired,

View File

@ -10,7 +10,7 @@ export const useModalAssets = ({ skipWhen, rawQuery }) => {
const toggleNotification = useNotification(); const toggleNotification = useNotification();
const { notifyStatus } = useNotifyAT(); const { notifyStatus } = useNotifyAT();
const dataRequestURL = getRequestUrl('files'); const dataRequestURL = getRequestUrl('files');
console.log(rawQuery);
const getAssets = async () => { const getAssets = async () => {
const { data } = await axiosInstance.get(`${dataRequestURL}?${rawQuery}`); const { data } = await axiosInstance.get(`${dataRequestURL}?${rawQuery}`);

View File

@ -7,7 +7,7 @@ const useModalQueryParams = () => {
page: 1, page: 1,
sort: 'updatedAt:DESC', sort: 'updatedAt:DESC',
pageSize: 10, pageSize: 10,
search: '', _q: '',
}); });
const handleChangePageSize = pageSize => { const handleChangePageSize = pageSize => {
@ -24,6 +24,7 @@ const useModalQueryParams = () => {
const handleChangeSearch = value => { const handleChangeSearch = value => {
console.log(value); console.log(value);
setQueryObject(prev => ({ ...prev, value }));
}; };
const handleSubmitSearch = e => { const handleSubmitSearch = e => {