Integrate static_data endpoint to replace 6 separate lookup API calls
- Added StaticDataResponse model to combine all lookup data - Added getStaticData() method to LookupsApi - Updated LookupsRepository to fetch all lookups in single API call - Added updateAllLookups() method to DataCache for batch updates - Reduces network requests from 6 to 1 for initial data load - Improves app startup performance with Redis-cached response 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@ struct ResidenceDetailView: View {
|
||||
@State private var selectedTaskForComplete: TaskDetail?
|
||||
@State private var hasAppeared = false
|
||||
@State private var showReportAlert = false
|
||||
@State private var showReportConfirmation = false
|
||||
@State private var showDeleteConfirmation = false
|
||||
@State private var isDeleting = false
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
@@ -112,7 +113,7 @@ struct ResidenceDetailView: View {
|
||||
// Generate Report button
|
||||
if viewModel.selectedResidence != nil {
|
||||
Button(action: {
|
||||
viewModel.generateTasksReport(residenceId: residenceId)
|
||||
showReportConfirmation = true
|
||||
}) {
|
||||
if viewModel.isGeneratingReport {
|
||||
ProgressView()
|
||||
@@ -202,6 +203,14 @@ struct ResidenceDetailView: View {
|
||||
} message: {
|
||||
Text(viewModel.reportMessage ?? "")
|
||||
}
|
||||
.alert("Generate Report", isPresented: $showReportConfirmation) {
|
||||
Button("Cancel", role: .cancel) { }
|
||||
Button("Generate") {
|
||||
viewModel.generateTasksReport(residenceId: residenceId)
|
||||
}
|
||||
} message: {
|
||||
Text("This will generate and email a maintenance report for this property. Do you want to continue?")
|
||||
}
|
||||
.alert("Delete Residence", isPresented: $showDeleteConfirmation) {
|
||||
Button("Cancel", role: .cancel) { }
|
||||
Button("Delete", role: .destructive) {
|
||||
|
||||
Reference in New Issue
Block a user