From f2333e10e17f1227d195a750e4754fe29dc0cd7a Mon Sep 17 00:00:00 2001 From: sylenien Date: Fri, 6 Jan 2023 16:26:13 +0100 Subject: [PATCH] fix(ui): fix method context --- frontend/app/mstore/alertsStore.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/app/mstore/alertsStore.ts b/frontend/app/mstore/alertsStore.ts index 25f90644d..744370671 100644 --- a/frontend/app/mstore/alertsStore.ts +++ b/frontend/app/mstore/alertsStore.ts @@ -14,11 +14,11 @@ export default class AlertsStore { makeAutoObservable(this); } - changeSearch(value: string) { + changeSearch = (value: string) => { this.alertsSearch = value; } - async fetchList() { + fetchList = async () => { this.loading = true try { const list = await alertsService.fetchList(); @@ -30,7 +30,7 @@ export default class AlertsStore { } } - async save(inst: Alert) { + save = async (inst: Alert) => { this.loading = true try { await alertsService.save(inst ? inst : this.instance) @@ -42,7 +42,7 @@ export default class AlertsStore { } } - async remove(id: string) { + remove = async (id: string) => { this.loading = true try { await alertsService.remove(id) @@ -53,7 +53,7 @@ export default class AlertsStore { } } - async fetchTriggerOptions() { + fetchTriggerOptions = async () => { this.loading = true try { const options = await alertsService.fetchTriggerOptions(); @@ -65,11 +65,11 @@ export default class AlertsStore { } } - init(inst: Partial | Alert) { + init = (inst: Partial | Alert) => { this.instance = inst instanceof Alert ? inst : new Alert(inst, false) } - edit(diff: Partial) { + edit = (diff: Partial) => { Object.assign(this.instance, diff) } } \ No newline at end of file