removeChild実装

This commit is contained in:
rca 2024-07-08 22:15:00 +09:00
parent 1b40da9eb0
commit c8b70ef635

View File

@ -133,7 +133,20 @@ public class ChildDataImpl implements ChildData {
@Override
public CompletableFuture<Void> removeChild(String childId) {
return CompletableFuture.completedFuture(null);
return CompletableFuture.supplyAsync(() -> {
Call<Void> call = kidShiftApiService.removeChild(childId);
try {
Response<Void> response = call.execute();
if (response.isSuccessful()) {
logger.info("子供削除成功(childId: " + childId + ")");
return null;
} else {
throw new RuntimeException("HTTP Status: " + response.code());
}
} catch (Exception e) {
throw new RuntimeException(e);
}
});
}
@Override