Skip to content

Commit 90627b1

Browse files
committed
fixing create action feature
1 parent 2044c2f commit 90627b1

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎src/routes/ProjectDetailPage.tsx‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ export default function ProjectDetailPage() {
622622
const handleCellClick = (taskId: string, dayNumber: number) => {
623623
// Check if there's already an action for this day
624624
const existingAction = actions.find(action =>
625-
action.taskId === taskId && action.dayNumber === dayNumber
625+
action.taskId === taskId && action.day === dayNumber
626626
);
627627

628628
if (existingAction) {
@@ -699,8 +699,8 @@ export default function ProjectDetailPage() {
699699

700700
const actionData = {
701701
taskId: selectedCellInfo.taskId,
702-
dayNumber: selectedCellInfo.dayNumber,
703-
details
702+
details,
703+
day: selectedCellInfo.dayNumber
704704
};
705705

706706
showNotification(`Creating action for Day ${selectedCellInfo.dayNumber}...`, 'success');
@@ -977,7 +977,7 @@ export default function ProjectDetailPage() {
977977

978978
// Check if there's an action for this task and day (only for tasks, not tags)
979979
const hasAction = !isTag && actions.some(action =>
980-
action.taskId === item.id && action.dayNumber === dayNumber
980+
action.taskId === item.id && action.day === dayNumber
981981
);
982982

983983
// Debug logging for first task and day 1 to verify actions are loaded
@@ -1659,7 +1659,7 @@ function ActionViewModal({ isOpen, action, isEditMode, onClose, onEdit, onSave,
16591659
onClick={(event) => event.stopPropagation()}
16601660
>
16611661
<div className="modal-header">
1662-
<h3 id="action-view-modal-title">Action for Day {action.dayNumber}</h3>
1662+
<h3 id="action-view-modal-title">Action for Day {action.day}</h3>
16631663
<button
16641664
type="button"
16651665
className="modal-close"

‎src/types.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,16 @@ export interface TaskWithNoteInput {
122122
export interface ActionRes {
123123
id: string;
124124
taskId: string;
125-
dayNumber: number;
125+
day: number;
126126
details: string;
127127
createdAt: string;
128128
updatedAt: string;
129129
}
130130

131131
export interface ActionCreateInput {
132132
taskId: string;
133-
dayNumber: number;
134133
details: string;
134+
day: number;
135135
}
136136

137137
export interface ActionUpdateInput {

0 commit comments

Comments
 (0)