Commit Graph

9 Commits

Author SHA1 Message Date
7c824b492e Modernize networking layer and fix category navigation and recipe list bugs
Network layer:
- Replace static CookbookApi protocol with instance-based CookbookApiProtocol
  using async/throws instead of tuple returns
- Refactor ApiRequest to use URLComponents for proper URL encoding, replace
  print statements with OSLog, and return typed NetworkError cases
- Add structured NetworkError variants (httpError, connectionError, etc.)
- Remove global cookbookApi constant in favor of injected dependency on AppState
- Delete unused RecipeEditViewModel, RecipeScraper, and Scraper playground

Data & model fixes:
- Add custom Decodable for RecipeDetail with safe fallbacks for malformed JSON
- Make Category Hashable/Equatable use only `name` so NavigationSplitView
  selection survives category refreshes with updated recipe_count
- Return server-assigned ID from uploadRecipe so new recipes get their ID
  before the post-upload refresh block executes

View updates:
- Refresh both old and new category recipe lists after upload when category
  changes, mapping empty recipeCategory to "*" for uncategorized recipes
- Raise deployment target to iOS 18, adopt new SwiftUI API conventions
- Clean up alerts, onboarding views, and settings

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 00:47:28 +01:00
VincentMeilinger
a6bd25ce3b Code cleanup 2024-02-03 17:51:51 +01:00
VincentMeilinger
4c2b459683 Bug fixes 2024-02-03 10:07:15 +01:00
Vincent Meilinger
2ed664857b users can now choose between http and https 2024-01-07 17:10:47 +01:00
Vicnet
bb68b29bdf Release Candidate Version 1.6 2023-12-15 13:43:56 +01:00
Vicnet
a3fc891d0a Better file caching and update management 2023-12-14 14:11:56 +01:00
Vicnet
5e4b87b201 Better API call handling. 2023-11-17 12:47:21 +01:00
Vicnet
23e1a665df Simpler api endpoints are now integrated into the MainViewModel 2023-11-16 17:53:30 +01:00
Vicnet
3563c23e29 Networking rework: simplified API calls. 2023-11-16 13:13:06 +01:00