Files
threshold-ui/ui/admin/app/controllers/scopes/scope/scopes/index.js
T
Zhihe Li f8b3792e62 Fix Searchbar debouncing in admin UI (#2735)
Applied ember-concurrency task usage to admin UI model hooks to help fix the debouncing issue.
2025-03-18 11:20:50 -04:00

32 lines
660 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import Controller from '@ember/controller';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
export default class ScopesScopeScopesIndexController extends Controller {
// =attributes
queryParams = ['search', 'page', 'pageSize'];
@tracked search;
@tracked page = 1;
@tracked pageSize = 10;
// =methods
/**
* Handles input on each keystroke and the search queryParam
* @param {object} event
*/
@action
handleSearchInput(event) {
const { value } = event.target;
this.search = value;
this.page = 1;
}
}