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:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user