summaryrefslogtreecommitdiffstats
path: root/ui/src/components/modlog.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-01-23 19:17:42 -0500
committerDessalines <tyhou13@gmx.com>2020-01-23 19:17:42 -0500
commitac1d5f2b86b0816cc9b5794dc6c38a38365ed839 (patch)
treebedaab04ca797113990e5702cad36f5e34e9e6e8 /ui/src/components/modlog.tsx
parent39d1fb4450cb418d9c11b31ea99484c2a177fab6 (diff)
parentb45c83682c187737b092080e83ba741c39cfa695 (diff)
Done merging http-api and private_message
Diffstat (limited to 'ui/src/components/modlog.tsx')
-rw-r--r--ui/src/components/modlog.tsx14
1 files changed, 7 insertions, 7 deletions
diff --git a/ui/src/components/modlog.tsx b/ui/src/components/modlog.tsx
index 6c35bce9..dd651092 100644
--- a/ui/src/components/modlog.tsx
+++ b/ui/src/components/modlog.tsx
@@ -17,7 +17,7 @@ import {
ModAdd,
} from '../interfaces';
import { WebSocketService } from '../services';
-import { msgOp, addTypeInfo, fetchLimit, toast } from '../utils';
+import { wsJsonToRes, addTypeInfo, fetchLimit, toast } from '../utils';
import { MomentTime } from './moment-time';
import moment from 'moment';
import { i18n } from '../i18next';
@@ -422,17 +422,17 @@ export class Modlog extends Component<any, ModlogState> {
WebSocketService.Instance.getModlog(modlogForm);
}
- parseMessage(msg: any) {
+ parseMessage(msg: WebSocketJsonResponse) {
console.log(msg);
- let op: UserOperation = msgOp(msg);
- if (msg.error) {
+ let res = wsJsonToRes(msg);
+ if (res.error) {
toast(i18n.t(msg.error), 'danger');
return;
- } else if (op == UserOperation.GetModlog) {
- let res: GetModlogResponse = msg;
+ } else if (res.op == UserOperation.GetModlog) {
+ let data = res.data as GetModlogResponse;
this.state.loading = false;
window.scrollTo(0, 0);
- this.setCombined(res);
+ this.setCombined(data);
}
}
}