Add report photo upload

This commit is contained in:
gabdevele
2026-06-02 19:41:19 +02:00 Unverified
parent e1c65903a3
commit 68d2a46584
7 changed files with 98 additions and 5 deletions
+16 -1
View File
@@ -372,5 +372,20 @@ Json::Value ReportService::addFeedback(const auth::UserContext &user,
body.get("comment", "").asString());
return success();
}
} // namespace visione::services
Json::Value ReportService::addPhoto(const auth::UserContext &user,
long long reportId,
const std::string &url)
{
if (!canAccessReport(user, reportId) || url.empty())
{
return failure("forbidden");
}
drogon::app().getDbClient()->execSqlSync(
"INSERT INTO report_photos (report_id, url) VALUES (?, ?)",
reportId,
url);
return success();
}
} // namespace visione::services