1
0
mirror of https://github.com/mgerb/classic-wow-forums synced 2026-01-11 17:42:48 +00:00

client - admin update thread/reply for locked/hidden/sticky

This commit is contained in:
2018-01-25 22:43:56 -06:00
parent 605e4ba94b
commit ce151bc0c0
8 changed files with 171 additions and 86 deletions

View File

@@ -23,7 +23,34 @@ const getThread = async (thread_id: string | number): Promise<ThreadModel> => {
return [] as any;
};
export interface ModUpdate {
id: number;
sticky?: boolean;
locked?: boolean;
hidden?: boolean;
}
const modUpdateThread = async (params: ModUpdate): Promise<any> => {
try {
const res = await axios.put('/api/thread/mod', params);
return res.data.data;
} catch (e) {
console.log(e);
}
};
const modUpdateReply = async (params: { id: number, hidden?: boolean }): Promise<any> => {
try {
const res = await axios.put('/api/reply/mod', params);
return res.data.data;
} catch (e) {
console.log(e);
}
};
export const ThreadService = {
getCategoryThreads,
getThread,
modUpdateReply,
modUpdateThread,
};