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

cache character end point - update reply count/thread reply id

This commit is contained in:
2018-01-09 23:24:09 -06:00
parent 2d6ff0875f
commit d3d3bef9a5
17 changed files with 226 additions and 22 deletions

View File

@@ -0,0 +1,29 @@
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 res.data.data;
} catch (e) {
console.error(e);
}
return [];
};
const getThread = async (thread_id: string | number): Promise<ThreadModel> => {
try {
const res = await axios.get(`/api/thread/${thread_id}`);
return res.data.data;
} catch (e) {
console.error(e);
}
return [] as any;
};
export const ThreadService = {
getCategoryThreads,
getThread,
};