( path: string, fallback: T, query?: Record<string, any>, tags: string[] = ["wordpress"] )
| 77 | |
| 78 | // Graceful fetch - returns fallback when WordPress unavailable or on error |
| 79 | async function wordpressFetchGraceful<T>( |
| 80 | path: string, |
| 81 | fallback: T, |
| 82 | query?: Record<string, any>, |
| 83 | tags: string[] = ["wordpress"] |
| 84 | ): Promise<T> { |
| 85 | if (!isConfigured) return fallback; |
| 86 | |
| 87 | try { |
| 88 | return await wordpressFetch<T>(path, query, tags); |
| 89 | } catch { |
| 90 | console.warn(`WordPress fetch failed for ${path}`); |
| 91 | return fallback; |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | // Paginated fetch - returns response with headers |
| 96 | async function wordpressFetchPaginated<T>( |
no outgoing calls
no test coverage detected