MCPcopy
hub / github.com/callumalpass/tasknotes / updateTaskProperty

Method updateTaskProperty

src/main.ts:1084–1119  ·  view source on GitHub ↗
(
		task: TaskInfo,
		property: keyof TaskInfo,
		value: TaskInfo[keyof TaskInfo],
		options: { silent?: boolean } = {}
	)

Source from the content-addressed store, hash-verified

1082 }
1083
1084 async updateTaskProperty(
1085 task: TaskInfo,
1086 property: keyof TaskInfo,
1087 value: TaskInfo[keyof TaskInfo],
1088 options: { silent?: boolean } = {}
1089 ): Promise<TaskInfo> {
1090 try {
1091 const updatedTask = await this.taskService.updateProperty(
1092 task,
1093 property,
1094 value,
1095 options
1096 );
1097
1098 // Provide user feedback unless silent
1099 if (!options.silent) {
1100 if (property === "status") {
1101 const statusValue = typeof value === "string" ? value : String(value);
1102 const statusConfig = this.statusManager.getStatusConfig(statusValue);
1103 new Notice(`Task marked as '${statusConfig?.label || statusValue}'`);
1104 } else {
1105 new Notice(`Task ${property} updated`);
1106 }
1107 }
1108
1109 return updatedTask;
1110 } catch (error) {
1111 tasknotesLogger.error(`Failed to update task ${property}:`, {
1112 category: "validation",
1113 operation: "update-task",
1114 error: error,
1115 });
1116 new Notice(`Failed to update task ${property}`);
1117 throw error;
1118 }
1119 }
1120
1121 /**
1122 * Toggles a recurring task's completion status for the selected date

Callers 15

buildMenuMethod · 0.80
updateTaskContextsMethod · 0.80
updateTaskTagsMethod · 0.80
addStatusOptionsMethod · 0.80
addPriorityOptionsMethod · 0.80
updateCustomDateFieldMethod · 0.80

Calls 3

updatePropertyMethod · 0.80
errorMethod · 0.80
getStatusConfigMethod · 0.65

Tested by

no test coverage detected