Enhance task synchronization and logging; update service worker caching strategy

This commit is contained in:
2025-01-31 18:59:16 +01:00
parent 2a7005f53c
commit b277b1f8f0
3 changed files with 45 additions and 19 deletions

View File

@@ -52,13 +52,13 @@ router.post('/add-task', auth, async (req, res) => {
- State "TODO" from "TODO" [${currentDateTime}]
:END:
`;
logger.info(`Task added: ${orgFormattedData}`);
}
const filePath = path.join(dataDir, 'tasks.org');
try {
await fs.promises.appendFile(filePath, orgFormattedData);
res.json({ message: 'Task added successfully' });
logger.info(`Task added: ${orgFormattedData}`);
} catch (error) {
logger.error('Error writing to tasks.org file:', error);
res.status(500).json({ message: 'Error adding task' });