mirror of
https://github.com/zadam/trilium.git
synced 2025-12-24 00:04:23 +01:00
feat(tasks): store parent note ID
This commit is contained in:
parent
034b93c99c
commit
bb822126cd
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user