-
-
Notifications
You must be signed in to change notification settings - Fork 134
Expand file tree
/
Copy pathfix-createroute.ps1
More file actions
33 lines (30 loc) · 1.31 KB
/
fix-createroute.ps1
File metadata and controls
33 lines (30 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Script to add await to all createRoute() calls in API routes
$files = @(
"app\api\user\route.ts",
"app\api\templates\route.ts",
"app\api\stripe\webhook\route.ts",
"app\api\stripe\create-portal-session\route.ts",
"app\api\stripe\create-portal\route.ts",
"app\api\stripe\create-checkout-session\route.ts",
"app\api\stripe\create-payment-intent\route.ts",
"app\api\stripe\create-checkout\route.ts",
"app\api\stripe\check-subscription\route.ts",
"app\api\presentations\regenerate-image\route.ts",
"app\api\generate\website\route.ts",
"app\api\documents\create-from-template\route.ts",
"app\api\documents\[id]\route.ts",
"app\api\auth\register\route.ts"
)
$rootPath = "C:\Users\Muneer Ali Subzwari\Desktop\draftdeckai\DraftDeckAI"
foreach ($file in $files) {
$fullPath = Join-Path $rootPath $file
if (Test-Path $fullPath) {
$content = Get-Content $fullPath -Raw
$updatedContent = $content -replace 'const supabase = createRoute\(\);', 'const supabase = await createRoute();'
Set-Content -Path $fullPath -Value $updatedContent -NoNewline
Write-Host "Updated: $file" -ForegroundColor Green
} else {
Write-Host "File not found: $file" -ForegroundColor Yellow
}
}
Write-Host "`nAll files updated successfully!" -ForegroundColor Cyan