Allowed outfits to be retagged/updated
This commit is contained in:
parent
cf698be97e
commit
a53bc60f4b
@ -169,6 +169,16 @@ public class OutfitController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static CompletableFuture<Void> update(Outfit outfit) {
|
||||||
|
return CompletableFuture.runAsync(() -> {
|
||||||
|
try {
|
||||||
|
updateExec(outfit);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
throw new CompletionException(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public static CompletableFuture<Void> delete(String id) {
|
public static CompletableFuture<Void> delete(String id) {
|
||||||
return CompletableFuture.runAsync(() -> {
|
return CompletableFuture.runAsync(() -> {
|
||||||
try {
|
try {
|
||||||
@ -333,6 +343,22 @@ public class OutfitController {
|
|||||||
return tags;
|
return tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void updateExec(Outfit outfit) throws SQLException {
|
||||||
|
FSDB.get().query("UPDATE outfits SET " +
|
||||||
|
"link = ?," +
|
||||||
|
"submitter = ?," +
|
||||||
|
"tag = ?," +
|
||||||
|
"updated = ?," +
|
||||||
|
"featured = ?," +
|
||||||
|
"display_count = ?" +
|
||||||
|
"WHERE id = ?",
|
||||||
|
outfit.getLink(),
|
||||||
|
outfit.getSubmitter(),
|
||||||
|
outfit.getTag(),
|
||||||
|
outfit.isFeatured(),
|
||||||
|
outfit.getDisplayCount());
|
||||||
|
}
|
||||||
|
|
||||||
private static void deleteExec(String id) throws SQLException {
|
private static void deleteExec(String id) throws SQLException {
|
||||||
FSDB.get().query("UPDATE outfits SET deleted = true WHERE id = ?", id);
|
FSDB.get().query("UPDATE outfits SET deleted = true WHERE id = ?", id);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user