Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions frontend/src/hooks/useTasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const useTasks = ({
limit: data.limit || initialLimit,
});
} catch (error) {
console.log(error?.response?.data?.message || "Failed to load tasks");
setTasks([]);
} finally {
setLoading(false);
Expand All @@ -64,9 +63,7 @@ const useTasks = ({
// create new task
const addTask = async (taskData) => {
try {
const response = await api.post("/tasks", taskData);

console.log("Task added:", response.data);
await api.post("/tasks", taskData);

invalidateTasks();

Expand All @@ -76,13 +73,6 @@ const useTasks = ({
setPage(DEFAULT_PAGE);
}
} catch (error) {
console.log("FULL ERROR:", error);
console.log(
error?.response?.data?.message ||
error?.response?.data ||
error.message,
);
alert(error?.response?.data?.message || "Failed to create task");
throw error;
}
};
Expand Down Expand Up @@ -114,7 +104,6 @@ const useTasks = ({
invalidateTasks();
await getTasks(page);
} catch (error) {
console.log(error?.response?.data?.message || "Failed to update task");
invalidateTasks();
await getTasks(page);
}
Expand Down