1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

API: Fixes #6862 set todo related fields when adding or changing a todo (#7395)

This commit is contained in:
Wartijn 2023-01-11 20:14:19 +01:00 committed by GitHub
parent 3bee0a142b
commit 4e942afba6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -298,7 +298,11 @@ describe('services_rest_Api', function() {
title: 'testing 4', title: 'testing 4',
parent_id: f.id, parent_id: f.id,
is_todo: '1', is_todo: '1',
todo_due: '2',
todo_completed: '3',
})); }));
expect(response.todo_due).toBe(2);
expect(response.todo_completed).toBe(3);
})); }));
it('should create folders with supplied ID', (async () => { it('should create folders with supplied ID', (async () => {

View File

@ -108,6 +108,8 @@ async function requestNoteToNote(requestNote: any) {
if ('user_updated_time' in requestNote) output.user_updated_time = Database.formatValue(Database.TYPE_INT, requestNote.user_updated_time); if ('user_updated_time' in requestNote) output.user_updated_time = Database.formatValue(Database.TYPE_INT, requestNote.user_updated_time);
if ('user_created_time' in requestNote) output.user_created_time = Database.formatValue(Database.TYPE_INT, requestNote.user_created_time); if ('user_created_time' in requestNote) output.user_created_time = Database.formatValue(Database.TYPE_INT, requestNote.user_created_time);
if ('is_todo' in requestNote) output.is_todo = Database.formatValue(Database.TYPE_INT, requestNote.is_todo); if ('is_todo' in requestNote) output.is_todo = Database.formatValue(Database.TYPE_INT, requestNote.is_todo);
if ('todo_due' in requestNote) output.todo_due = Database.formatValue(Database.TYPE_INT, requestNote.todo_due);
if ('todo_completed' in requestNote) output.todo_completed = Database.formatValue(Database.TYPE_INT, requestNote.todo_completed);
if ('markup_language' in requestNote) output.markup_language = Database.formatValue(Database.TYPE_INT, requestNote.markup_language); if ('markup_language' in requestNote) output.markup_language = Database.formatValue(Database.TYPE_INT, requestNote.markup_language);
if ('longitude' in requestNote) output.longitude = requestNote.longitude; if ('longitude' in requestNote) output.longitude = requestNote.longitude;
if ('latitude' in requestNote) output.latitude = requestNote.latitude; if ('latitude' in requestNote) output.latitude = requestNote.latitude;