1
0
mirror of https://github.com/mgerb/classic-wow-forums synced 2026-01-11 09:32:51 +00:00

client - support for admin/mod users

This commit is contained in:
2018-01-16 22:02:19 -06:00
parent b30af0cd09
commit 8de5dba9e3
15 changed files with 175 additions and 59 deletions

View File

@@ -1,13 +1,10 @@
import { orderBy } from 'lodash';
import axios from '../axios/axios';
import { ThreadModel } from '../model';
const getCategoryThreads = async (category_id: string): Promise<ThreadModel[]> => {
try {
const res = await axios.get(`/api/thread?category_id=${category_id}`);
return orderBy(res.data.data as ThreadModel[], (thread: ThreadModel) => {
return -(new Date(thread.updated_at));
});
return res.data.data;
} catch (e) {
console.error(e);
}