Skip to content
Snippets Groups Projects
Commit 24624d99 authored by Jérémie BRISON's avatar Jérémie BRISON
Browse files

clean code

parent ffadf0c3
No related branches found
No related tags found
2 merge requests!31Recette,!12Topic search
...@@ -27,7 +27,6 @@ export class SearchComponent implements OnInit { ...@@ -27,7 +27,6 @@ export class SearchComponent implements OnInit {
// Modal variable // Modal variable
public categories: Category[]; public categories: Category[];
public modalTypeOpened: TypeModal; // todo: utiliser enum public modalTypeOpened: TypeModal; // todo: utiliser enum
public isOpenModal = false;
// Checkbox variable // Checkbox variable
public checkedModulesFilter: Module[]; public checkedModulesFilter: Module[];
...@@ -75,7 +74,6 @@ export class SearchComponent implements OnInit { ...@@ -75,7 +74,6 @@ export class SearchComponent implements OnInit {
public fetchResults(checkedModules: Module[]): void { public fetchResults(checkedModules: Module[]): void {
const inputTerm = this.searchForm.get('searchTerm').value; const inputTerm = this.searchForm.get('searchTerm').value;
console.log(checkedModules);
// Check if some modules is checked in filters // Check if some modules is checked in filters
if (this.checkedModulesFilter !== checkedModules) { if (this.checkedModulesFilter !== checkedModules) {
// First btn // First btn
...@@ -121,7 +119,7 @@ export class SearchComponent implements OnInit { ...@@ -121,7 +119,7 @@ export class SearchComponent implements OnInit {
// Open the modal and display the list according to the right filter button // Open the modal and display the list according to the right filter button
public openModal(modalType: TypeModal): void { public openModal(modalType: TypeModal): void {
this.categories = []; this.categories = [];
// if modal already closed, reset type // if modal already opened, reset type
if (this.modalTypeOpened === modalType) { if (this.modalTypeOpened === modalType) {
this.modalTypeOpened = undefined; this.modalTypeOpened = undefined;
} else if (this.modalTypeOpened !== modalType) { } else if (this.modalTypeOpened !== modalType) {
...@@ -131,7 +129,6 @@ export class SearchComponent implements OnInit { ...@@ -131,7 +129,6 @@ export class SearchComponent implements OnInit {
} }
public closeModal(): void { public closeModal(): void {
//this.openModal(this.modalTypeOpened);
this.modalTypeOpened = undefined; this.modalTypeOpened = undefined;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment