From 34b1fabe12f38c4266884361eaa063f643788a38 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Wed, 2 Jul 2025 23:30:28 -0400 Subject: [PATCH] starting practiced_songs --- server.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/server.cpp b/server.cpp index 393bec4..165e8c1 100644 --- a/server.cpp +++ b/server.cpp @@ -184,6 +184,26 @@ int main() string created_at = res->getString("created_at"); string category = res->getString("category"); string instrument = res->getString("instrument"); + + crow::json::wvalue songs; + int song_id = res->getInt("song_id"); + string song_title = res->getString("title"); + + songs[0] = { + {"id", song_id}, + {"title", song_title} + }; + + //crow::json::wvalue currentSong; + //currentSong["id"] = res->getInt("song_id"); + //currentSong["title"] = res->getString("title"); + + //crow::json::wvalue currentSong = { + //{"id", res->getInt("song_id")}, + //{"title", res->getString("title")} + //}; + //songs.push_back(std::move(currentSong)); + entries[i] = { {"id", id}, {"description", description}, @@ -191,7 +211,8 @@ int main() {"comments", comments}, {"created_at", created_at}, {"category", category}, - {"instrument", instrument} + {"instrument", instrument}, + {"songs", songs} }; i++; }