More work on todo list
This commit is contained in:
@ -54,6 +54,11 @@ export type Todo = {
|
||||
value: string;
|
||||
};
|
||||
|
||||
export type CreateTodo = {
|
||||
channel_id: string;
|
||||
value: string;
|
||||
};
|
||||
|
||||
export type ChannelInfo = {
|
||||
id: string;
|
||||
name: string;
|
||||
@ -209,17 +214,12 @@ export const patchGuildTodo = (guild: string) => ({
|
||||
});
|
||||
|
||||
export const postGuildTodo = (guild: string) => ({
|
||||
mutationFn: (reminder: Reminder) =>
|
||||
axios.post(`/dashboard/api/guild/${guild}/todos`, reminder).then((resp) => resp.data),
|
||||
mutationFn: (todo: CreateTodo) =>
|
||||
axios.post(`/dashboard/api/guild/${guild}/todos`, todo).then((resp) => resp.data),
|
||||
});
|
||||
|
||||
export const deleteGuildTodo = () => ({
|
||||
mutationFn: (todo: Todo) =>
|
||||
axios.delete(`/dashboard/api/todos`, {
|
||||
data: {
|
||||
id: todo.id,
|
||||
},
|
||||
}),
|
||||
export const deleteGuildTodo = (guild: string) => ({
|
||||
mutationFn: (todoId: number) => axios.delete(`/dashboard/api/guild/${guild}/todos/${todoId}`),
|
||||
});
|
||||
|
||||
export const fetchUserReminders = () => ({
|
||||
|
Reference in New Issue
Block a user