Skip to content

Commit d557ba5

Browse files
fix: Delete the associated databases when there are no more submissions for a project.
1 parent 6844237 commit d557ba5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/net/modgarden/backend/handler/v1/discord/DiscordBotSubmissionHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ public static void unsubmit(Context ctx) {
275275
}
276276
String projectId = projectAttributionResult.getString(1);
277277

278-
// Delete the submission from the database.
279278
deleteSubmissionStatement.setString(1, projectId);
280279
deleteSubmissionStatement.setString(2, event.id());
281280
int updated = deleteSubmissionStatement.executeUpdate();
@@ -292,7 +291,7 @@ public static void unsubmit(Context ctx) {
292291

293292
checkSubmissionStatement.setString(1, projectId);
294293
ResultSet submissionResult = checkSubmissionStatement.executeQuery();
295-
if (submissionResult.getBoolean(1)) {
294+
if (!submissionResult.getBoolean(1)) {
296295
projectDeleteStatement.setString(1, projectId);
297296
projectDeleteStatement.execute();
298297

0 commit comments

Comments
 (0)