Skip to content

Commit ec5955b

Browse files
committed
fix: Ensure type safety in data handling and update completion conditions in documentation
1 parent dce7d36 commit ec5955b

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

CLAUDE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,5 @@ X_INTEGRATION_ID=your_integration_id
101101
- Manual testing guide available for task-management function
102102

103103
## Memories
104-
- Be sure to run test as a completion check.
104+
- Be sure to run test as a completion check.
105+
- As a condition for completion, make sure that the npm run build succeeds

ui/src/pages/IntegrationKeys.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ const IntegrationKeysPage = () => {
4242
const { data, error } = await supabase
4343
.from("integration_keys")
4444
.select("*")
45-
.eq("user_id", user?.id)
45+
.eq("user_id", user?.id!)
4646
.order("created_at", { ascending: false });
4747

4848
if (error) throw error;
49-
setKeys(data || []);
49+
setKeys((data as unknown as IntegrationKey[]) || []);
5050
} catch (error: any) {
5151
toast({
5252
variant: "destructive",

ui/src/pages/TaskList/TaskList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const TaskList = () => {
9191
if (error) {
9292
console.error("Error fetching categories:", error);
9393
} else if (data) {
94-
setCategories(data as Category[]);
94+
setCategories((data as unknown as Category[]) || []);
9595
}
9696
})();
9797
}, []);
@@ -117,7 +117,7 @@ const TaskList = () => {
117117
if (error) {
118118
console.error("Error fetching tasks:", error);
119119
} else if (data) {
120-
dispatch({ type: "SET_TASKS", payload: data as Task[] });
120+
dispatch({ type: "SET_TASKS", payload: (data as unknown as Task[]) || [] });
121121
}
122122
})(selectedDate);
123123
}
@@ -208,7 +208,7 @@ const TaskList = () => {
208208
console.error("Error adding task:", error);
209209
} else {
210210
// 新しく追加されたタスクをリストの先頭に追加
211-
dispatch({ type: "ADD_TASK", payload: data[0] as Task });
211+
dispatch({ type: "ADD_TASK", payload: (data?.[0] as unknown as Task) || {} as Task });
212212

213213
// 入力フィールドをリセット
214214
setNewTaskTitle("");

0 commit comments

Comments
 (0)