'Generic Commit'
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 10s
Build-Test-Publish / build (linux/arm64) (push) Successful in 1m11s
Build-Test-Publish / create-manifest (push) Has been skipped

This commit is contained in:
Your Name
2025-06-15 22:48:50 +12:00
parent 22dab2795a
commit 2b3e761f54
2 changed files with 401 additions and 355 deletions

View File

@@ -120,10 +120,16 @@ void UpdateHandler::handle_update_object(const drogon::HttpRequestPtr& req, std:
return;
}
// Prepare updated entry (keep hash and labeltags, update metadata)
// Prepare updated entry
dbEntry updated_entry = entry;
updated_entry.metadata = new_metadata;
// Ensure labeltags and hash are preserved in metadata
// Update labeltags if provided in the new metadata
if (new_metadata.contains("labeltags") && new_metadata["labeltags"].is_array()) {
updated_entry.labeltags = new_metadata["labeltags"].get<std::vector<std::string>>();
}
// Ensure labeltags and hash are reflected in metadata
updated_entry.metadata["labeltags"] = updated_entry.labeltags;
updated_entry.metadata["hash"] = updated_entry.hash;