Added operation for deleting outfits

This commit is contained in:
Salmonllama 2020-11-13 19:27:13 -05:00
parent 24d1cd7425
commit 1d8dcacd8a

View File

@ -200,6 +200,16 @@ public class OutfitController {
});
}
public static CompletableFuture<Void> forceRemove(String id) {
return CompletableFuture.runAsync(() -> {
try {
forceRemoveExec(id);
} catch (SQLException e) {
throw new CompletionException(e);
}
});
}
private static void insertExec(Outfit outfit) throws SQLException {
if (outfit.getCreated() == null) {
outfit.setCreated(new Timestamp(System.currentTimeMillis()));
@ -369,6 +379,10 @@ public class OutfitController {
FSDB.get().query("UPDATE outfits SET deleted = true WHERE id = ?", id);
}
private static void forceRemoveExec(String id) throws SQLException {
FSDB.get().query("DELETE FROM outfits WHERE id = ?", id);
}
private static Optional<Collection<Outfit>> extractMultiple(ResultSet rs) throws SQLException {
Collection<Outfit> outfits = new ArrayList<>();