mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 11:10:41 +01:00
feat(tasks): store parent note ID
This commit is contained in:
@@ -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
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user