Fix type error in SupabaseConnectionTest

The TestResults type was not assignable to the TestResult type in the SupabaseConnectionTest component. This commit ensures the types are compatible.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-15 12:43:46 +00:00
parent dc92138a48
commit 1e6d360d69
5 changed files with 24 additions and 26 deletions

View File

@@ -10,6 +10,7 @@ export const testSupabaseConnection = async (): Promise<TestResults> => {
// 기본 결과 객체 초기화
const results: TestResults = {
url: getSupabaseUrl(),
proxyUrl: '', // 빈 문자열로 초기화
usingProxy: isCorsProxyEnabled(),
proxyType: getProxyType(),
client: true,
@@ -27,6 +28,22 @@ export const testSupabaseConnection = async (): Promise<TestResults> => {
return results;
}
// CORS 프록시 URL 설정
if (results.usingProxy) {
const baseUrl = getSupabaseUrl();
const proxyType = getProxyType();
if (proxyType === 'corsproxy.io') {
results.proxyUrl = `https://corsproxy.io/?${encodeURIComponent(baseUrl)}`;
} else if (proxyType === 'cors-anywhere') {
results.proxyUrl = `https://cors-anywhere.herokuapp.com/${baseUrl}`;
} else {
results.proxyUrl = baseUrl; // 기본값
}
} else {
results.proxyUrl = results.url; // 프록시 사용 안 함
}
// 테스트 실행
const authResults = await testAuth(supabase, results.url);
const apiResults = await testRestApi(supabase);