diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index 1755b38..34b405a 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/app/javascript/controllers/index.js b/app/javascript/controllers/index.js index a1f30d3..c00a360 100644 --- a/app/javascript/controllers/index.js +++ b/app/javascript/controllers/index.js @@ -34,8 +34,5 @@ application.register("navbar-link", NavbarLinkController) import PagyController from "./pagy_controller" application.register("pagy", PagyController) -import SearchCountriesController from "./search_countries_controller" -application.register("search-countries", SearchCountriesController) - import SearchLocationsController from "./search_locations_controller" application.register("search-locations", SearchLocationsController) diff --git a/app/javascript/controllers/search_countries_controller.js b/app/javascript/controllers/search_countries_controller.js deleted file mode 100644 index 29777bb..0000000 --- a/app/javascript/controllers/search_countries_controller.js +++ /dev/null @@ -1,39 +0,0 @@ -import { Controller } from "@hotwired/stimulus" - -export default class extends Controller { - static targets = [ - "searchField", - "searchResults", - ]; - static values = { - searchUrl: String, - }; - - connect() { - const _ = require("lodash"); - - this.debouncedSearch = _.debounce((query) => { - this.searchResultsTarget.innerHTML = ""; - this.searchResultsTarget.append( - // Show loading spinner - new DOMParser().parseFromString( - '
Loading...
', - 'text/html' - ).body - ); - fetch( - this.searchUrlValue + `?query=${this.searchFieldTarget.value}`, - { - method: "GET", - } - ).then ((response) => response.text()) - .then((html) => { - Turbo.renderStreamMessage(html); - }); - }, 750); - } - - searchOnDebounce() { - this.debouncedSearch(this.searchFieldTarget.value); - } -} diff --git a/package.json b/package.json index e89a6dd..2550a02 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,6 @@ "choices.js": "^10.2.0", "cssnano": "^7.0.1", "esbuild": "^0.19.3", - "lodash": "^4.17.21", "nodemon": "^3.0.1", "postcss": "^8.4.30", "postcss-cli": "^10.1.0", diff --git a/yarn.lock b/yarn.lock index 40b2186..9e06421 100644 --- a/yarn.lock +++ b/yarn.lock @@ -373,7 +373,6 @@ __metadata: choices.js: ^10.2.0 cssnano: ^7.0.1 esbuild: ^0.19.3 - lodash: ^4.17.21 nodemon: ^3.0.1 postcss: ^8.4.30 postcss-cli: ^10.1.0 @@ -1478,13 +1477,6 @@ __metadata: languageName: node linkType: hard -"lodash@npm:^4.17.21": - version: 4.17.21 - resolution: "lodash@npm:4.17.21" - checksum: eb835a2e51d381e561e508ce932ea50a8e5a68f4ebdd771ea240d3048244a8d13658acbd502cd4829768c56f2e16bdd4340b9ea141297d472517b83868e677f7 - languageName: node - linkType: hard - "lru-cache@npm:^6.0.0": version: 6.0.0 resolution: "lru-cache@npm:6.0.0"