feat(tasks): store parent note ID

This commit is contained in:
Elian Doran
2025-02-19 21:52:33 +02:00
parent 034b93c99c
commit bb822126cd
2 changed files with 12 additions and 3 deletions

View File

@@ -1,7 +1,13 @@
import server from "./server.js";
export async function createNewTask(title: string) {
interface CreateNewTasksOpts {
parentNoteId: string;
title: string;
}
export async function createNewTask({ parentNoteId, title }: CreateNewTasksOpts) {
await server.post(`tasks`, {
parentNoteId,
title
});
}

View File

@@ -95,11 +95,14 @@ export default class TaskListWidget extends TypeWidget {
}
async #createNewTask(title: string) {
if (!title) {
if (!title || !this.noteId) {
return;
}
await taskService.createNewTask(title);
await taskService.createNewTask({
title,
parentNoteId: this.noteId
});
}
async doRefresh(note: FNote) {