Problem: The Google Places API (New) was returning 400 errors with messages like:
Invalid included_primary_types 'coworking_space'. See the list of supported types...
Root Cause: We were using place types from the legacy Places API that are not valid in the new API.
Updated all place type mappings to use only valid types from the Google Places API (New):
Before:
lunch: ['restaurant', 'cafe', 'fast_food_restaurant', 'bakery'],
dinner: ['restaurant', 'bar', 'night_club'],
coffee: ['cafe', 'coffee_shop', 'bakery'],
meeting: ['cafe', 'restaurant', 'coworking_space'],
workout: ['gym', 'fitness_center', 'sports_club'],After:
lunch: ['restaurant', 'cafe', 'bakery'],
dinner: ['restaurant', 'bar', 'night_club'],
coffee: ['cafe', 'bakery'],
meeting: ['cafe', 'restaurant', 'corporate_office'],
workout: ['gym', 'sports_complex'],fast_food_restaurant→ Userestaurantinsteadcoffee_shop→ Usecafeinsteadcoworking_space→ Usecorporate_officeinsteadfitness_center→ Usegyminsteadsports_club→ Usesports_complexinstead
Also updated all static location suggestions to remove invalid types:
- Removed:
healthy,fine_dining,meeting_space,club,fitness,crossfit,shopping_area,music_venue - Replaced with valid types or generic
establishment
-
src/renderer/services/location.ts- Updated
getPlaceTypesForEvent()function - Updated
getStaticSuggestions()function
- Updated
-
GOOGLE_PLACES_NEW_API_SETUP.md- Added troubleshooting section for place type errors
After these changes:
- Google Places API (New) autocomplete should work without 400 errors
- Location suggestions should appear in smart scheduling
- Static fallback should use valid place types
- Google Places API (New) Place Types
- Valid types are listed in Table A and Table B of the documentation