export interface CommuneData { nom: string code: string } export async function getCommunesByPostalCode(postalCode: string): Promise { const config = useRuntimeConfig() const base = config.public.geoApiBase try { return await $fetch(`${base}/communes`, { params: { codePostal: postalCode, fields: 'nom', format: 'json' } }) } catch { return [] } }