Skip to content

Commit 2e56b44

Browse files
committed
feat(Gestion): update search input on historical and favorite updates
1 parent 676bfed commit 2e56b44

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

components/Panel/Item/HistoricalPanel.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@
9999
}
100100
101101
await this.$accessor.exercises.fetch({data: {tags: tagsRequest, title: title, vote: historical.vote}});
102+
103+
this.$emit('refresh');
102104
}
103105
}
104106
</script>

pages/administration/exercices/index.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
@reset="resetInput"/>
2222
</PanelItem>
2323
<PanelItem>
24-
<HistoricalPanel/>
24+
<HistoricalPanel @refresh="refreshInput"/>
2525
</PanelItem>
2626

2727
<PanelItem>
28-
<FavoritePanel/>
28+
<FavoritePanel @fetch="refreshInput"/>
2929
</PanelItem>
3030
</Panel>
3131

@@ -370,6 +370,10 @@
370370
}
371371
}
372372
373+
refreshInput() {
374+
this.inputText.value = this.$accessor.exercises.search_criterion.title || '';
375+
}
376+
373377
/**
374378
* Reset the input value
375379
*/

pages/exercices/index.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
@reset="resetInput"/>
1717
</PanelItem>
1818
<PanelItem>
19-
<HistoricalPanel/>
19+
<HistoricalPanel @refresh="refreshInput"/>
2020
</PanelItem>
2121

2222
<PanelItem :is-active="$auth.loggedIn">
@@ -39,7 +39,6 @@
3939
import Panel from "~/components/Panel/Panel.vue";
4040
import PanelItem from "~/components/Panel/PanelItem.vue";
4141
import RadioButtonSelecter from "~/components/Search/RadioButtonSelecter.vue";
42-
import {AxiosError} from "axios";
4342
4443
@Component({
4544
components: {
@@ -90,6 +89,10 @@
9089
this.inputText.value = ""
9190
}
9291
92+
refreshInput() {
93+
this.inputText.value = this.$accessor.exercises.search_criterion.title || '';
94+
}
95+
9396
setInput() {
9497
const title = this.$accessor.exercises.search_criterion.title;
9598
this.inputText.value = !!title ? title : '';

pages/gestion/mes-exercices/index.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
@reset="resetInput"/>
2222
</PanelItem>
2323
<PanelItem>
24-
<HistoricalPanel/>
24+
<HistoricalPanel @refresh="refreshInput"/>
2525
</PanelItem>
2626

2727
<PanelItem>
28-
<FavoritePanel/>
28+
<FavoritePanel @fetch="refreshInput"/>
2929
</PanelItem>
3030
</Panel>
3131

@@ -325,6 +325,11 @@
325325
}
326326
}
327327
328+
329+
refreshInput() {
330+
this.inputText.value = this.$accessor.exercises.search_criterion.title || '';
331+
}
332+
328333
/**
329334
* Reset the input value
330335
*/

0 commit comments

Comments
 (0)