removed lodash and axios

This commit is contained in:
2026-05-07 22:50:02 +03:00
parent daa4b268a6
commit a04cdd753d
24 changed files with 2191 additions and 4844 deletions
@@ -1,7 +1,7 @@
<script>
import { createEventDispatcher } from "svelte";
const dispatch = createEventDispatcher();
import { range } from "lodash";
import NavItem from "./NavItem.svelte";
export let inModal;
export let modalUrl;
@@ -11,7 +11,11 @@
$: totalPages = Math.ceil(total / limit);
$: currentPage = Math.ceil((skip - 1) / limit) + 1;
const range = (start, end, step = 1) =>
Array.from(
{ length: Math.ceil((end - start) / step) },
(_, i) => start + i * step,
);
$: pageRange = range(currentPage - 3, currentPage + 4).filter((i) => {
return i > 0 && i <= totalPages;
});
@@ -1,6 +1,6 @@
<script>
import { createEventDispatcher, getContext } from "svelte";
import { debounce } from "lodash";
import { apiGet, debounce } from "../../../helpers";
const channel = getContext("channel");
const dispatch = createEventDispatcher();
@@ -12,17 +12,16 @@
$: searchOptions = [];
const updateResults = debounce((e) => {
axios
.get(channel.lucentUrl + "/records/suggestions", {
params: {
schema: field.collections[0],
field: "search",
value: search,
ui: "search",
},
})
apiGet(channel.lucentUrl + "/records/suggestions", {
params: {
schema: field.collections[0],
field: "search",
value: search,
ui: "search",
},
})
.then((response) => {
searchOptions = response.data;
searchOptions = response;
})
.catch((error) => {
searchOptions = [];