From: Eric Wertz Date: Fri, 30 May 2025 23:33:44 +0000 (-0400) Subject: Working towards deployment X-Git-Url: https://ericdwertz.com/git/?a=commitdiff_plain;h=a8ad54d29f78be834e34a0fc754f69dec7b04b3b;p=listv4.git Working towards deployment --- diff --git a/backend/Controller.cpp b/backend/Controller.cpp index a1a479b..2104c1c 100644 --- a/backend/Controller.cpp +++ b/backend/Controller.cpp @@ -2,6 +2,8 @@ #include "JSONResponse.h" #include "HTTPExceptions.h" +#include + CHTTPResponse* CController::handle(CHTTPRequest& request, const std::vector& args) { auto actions = getActions(); diff --git a/backend/DBQuery.cpp b/backend/DBQuery.cpp index 16de9e0..cf7b5e8 100644 --- a/backend/DBQuery.cpp +++ b/backend/DBQuery.cpp @@ -1,4 +1,5 @@ #include "DBQuery.h" +#include CDBQuery::~CDBQuery() { diff --git a/backend/HTTPExceptions.h b/backend/HTTPExceptions.h index 4302953..cfef007 100644 --- a/backend/HTTPExceptions.h +++ b/backend/HTTPExceptions.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include class HTTPException : public std::runtime_error diff --git a/backend/HTTPRequestRouter.cpp b/backend/HTTPRequestRouter.cpp index 9954426..810ce2d 100644 --- a/backend/HTTPRequestRouter.cpp +++ b/backend/HTTPRequestRouter.cpp @@ -3,7 +3,9 @@ #include "AuthController.h" #include "JSONResponse.h" #include "ListController.h" + #include +#include const std::string frontendRoutes[] = { "/", diff --git a/backend/ListController.cpp b/backend/ListController.cpp index 650626d..3056556 100644 --- a/backend/ListController.cpp +++ b/backend/ListController.cpp @@ -269,6 +269,7 @@ CHTTPResponse* CListController::fetch(CHTTPRequest& request) { FROM items i LEFT JOIN itemslink il ON i.rowid = il.child_id AND il.type = 'listitem_hierarchy' WHERE i.type = 'listitem' AND il.parent_id IS NULL + AND IFNULL(json_extract(i.json, '$.completed_at'), '1970-01-01') < datetime('now', '-12 hours') UNION ALL @@ -292,6 +293,7 @@ CHTTPResponse* CListController::fetch(CHTTPRequest& request) { JOIN itemslink il ON child.rowid = il.child_id AND il.type = 'listitem_hierarchy' JOIN item_tree parent ON il.parent_id = parent.rowid WHERE child.type = 'listitem' + AND IFNULL(json_extract(child.json, '$.completed_at'), '1970-01-01') < datetime('now', '-12 hours') ), -- Build hierarchy by updating parent _children arrays hierarchy AS ( diff --git a/backend/User.cpp b/backend/User.cpp index d98d827..9bc082c 100644 --- a/backend/User.cpp +++ b/backend/User.cpp @@ -8,6 +8,7 @@ #include #include #include // Required for std::istringstream +#include #define SESSION_ID_LENGTH 32