Prevent re-saves from un-aborting user reports
This commit is contained in:
parent
3db7e27ecd
commit
db0bfece23
@ -54,7 +54,7 @@ public class ReportRepository
|
|||||||
private static final String SET_REPORT_MESSAGE = "REPLACE INTO reportReasons (reportId, reporterId, reason, `server`, weight, `time`)" +
|
private static final String SET_REPORT_MESSAGE = "REPLACE INTO reportReasons (reportId, reporterId, reason, `server`, weight, `time`)" +
|
||||||
" VALUES (?, ?, ?, ?, ?, ?);";
|
" VALUES (?, ?, ?, ?, ?, ?);";
|
||||||
|
|
||||||
private static final String SET_REPORT_HANDLER = "REPLACE INTO reportHandlers (reportId, handlerId)" +
|
private static final String INSERT_REPORT_HANDLER = "INSERT IGNORE INTO reportHandlers (reportId, handlerId)" +
|
||||||
" VALUES (?, ?);";
|
" VALUES (?, ?);";
|
||||||
|
|
||||||
private static final String SET_REPORT_RESULT = "REPLACE INTO reportResults (reportId, resultId, reason, closedTime)" +
|
private static final String SET_REPORT_RESULT = "REPLACE INTO reportResults (reportId, resultId, reason, closedTime)" +
|
||||||
@ -637,7 +637,7 @@ public class ReportRepository
|
|||||||
Optional<Integer> handlerIdOptional = report.getHandlerId();
|
Optional<Integer> handlerIdOptional = report.getHandlerId();
|
||||||
if (handlerIdOptional.isPresent())
|
if (handlerIdOptional.isPresent())
|
||||||
{
|
{
|
||||||
PreparedStatement setReportHandlerStatement = connection.prepareStatement(SET_REPORT_HANDLER);
|
PreparedStatement setReportHandlerStatement = connection.prepareStatement(INSERT_REPORT_HANDLER);
|
||||||
setReportHandlerStatement.setLong(1, reportId); // report id
|
setReportHandlerStatement.setLong(1, reportId); // report id
|
||||||
setReportHandlerStatement.setInt(2, handlerIdOptional.get()); // handler id
|
setReportHandlerStatement.setInt(2, handlerIdOptional.get()); // handler id
|
||||||
setReportHandlerStatement.execute();
|
setReportHandlerStatement.execute();
|
||||||
|
Loading…
Reference in New Issue
Block a user