Add delete/patch todos
This commit is contained in:
@ -49,7 +49,7 @@ export type Reminder = {
|
||||
};
|
||||
|
||||
export type Todo = {
|
||||
id: string;
|
||||
id: number;
|
||||
channel_id: string;
|
||||
value: string;
|
||||
};
|
||||
@ -59,6 +59,10 @@ export type CreateTodo = {
|
||||
value: string;
|
||||
};
|
||||
|
||||
export type UpdateTodo = {
|
||||
value: string;
|
||||
};
|
||||
|
||||
export type ChannelInfo = {
|
||||
id: string;
|
||||
name: string;
|
||||
@ -210,7 +214,7 @@ export const fetchGuildTodos = (guild: string) => ({
|
||||
});
|
||||
|
||||
export const patchGuildTodo = (guild: string) => ({
|
||||
mutationFn: (todo: Todo) => axios.patch(`/dashboard/api/guild/${guild}/todos`, todo),
|
||||
mutationFn: ({ id, todo }) => axios.patch(`/dashboard/api/guild/${guild}/todos/${id}`, todo),
|
||||
});
|
||||
|
||||
export const postGuildTodo = (guild: string) => ({
|
||||
|
Reference in New Issue
Block a user