mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-20 09:46:06 +02:00
Remove unneeded function
This commit is contained in:
parent
e3a3e09cb2
commit
fb36ec1a54
1 changed files with 18 additions and 22 deletions
|
@ -33,26 +33,6 @@ const showElement = (element) => {
|
||||||
element.classList.remove('display-none');
|
element.classList.remove('display-none');
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper function that returns commonly used search params for tables
|
|
||||||
* @param {*} page - Used for the paginator to determine which page we reside on
|
|
||||||
* @param {*} sortBy - which value to sort on. Passed to sort_by in django
|
|
||||||
* @param {*} order - which value to order on. Passed to order_by in django
|
|
||||||
* @param {*} status - Represents the status filter button
|
|
||||||
* @param {*} searchTerm - Represents the value of the search bar
|
|
||||||
*/
|
|
||||||
function getGenericTableSearchParams(page, sortBy, order, status, searchTerm) {
|
|
||||||
return new URLSearchParams(
|
|
||||||
{
|
|
||||||
"page": page,
|
|
||||||
"sort_by": sortBy,
|
|
||||||
"order": order,
|
|
||||||
"status": status,
|
|
||||||
"search_term": searchTerm
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function that scrolls to an element
|
* Helper function that scrolls to an element
|
||||||
* @param {string} attributeName - The string "class" or "id"
|
* @param {string} attributeName - The string "class" or "id"
|
||||||
|
@ -1216,7 +1196,15 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// fetch json of page of domains, given params
|
// fetch json of page of domains, given params
|
||||||
let searchParams = getGenericTableSearchParams(page, sort_by, order, status, search_term);
|
let searchParams = new URLSearchParams(
|
||||||
|
{
|
||||||
|
"page": page,
|
||||||
|
"sort_by": sortBy,
|
||||||
|
"order": order,
|
||||||
|
"status": status,
|
||||||
|
"search_term": searchTerm
|
||||||
|
}
|
||||||
|
);
|
||||||
if (portfolio)
|
if (portfolio)
|
||||||
searchParams.append("portfolio", portfolio)
|
searchParams.append("portfolio", portfolio)
|
||||||
|
|
||||||
|
@ -1570,7 +1558,15 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let searchParams = getGenericTableSearchParams(page, sort_by, order, status, search_term);
|
let searchParams = new URLSearchParams(
|
||||||
|
{
|
||||||
|
"page": page,
|
||||||
|
"sort_by": sortBy,
|
||||||
|
"order": order,
|
||||||
|
"status": status,
|
||||||
|
"search_term": searchTerm
|
||||||
|
}
|
||||||
|
);
|
||||||
if (portfolio)
|
if (portfolio)
|
||||||
searchParams.append("portfolio", portfolio)
|
searchParams.append("portfolio", portfolio)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue