diff options
| author | Fuwn <[email protected]> | 2026-02-07 02:00:59 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-07 02:00:59 -0800 |
| commit | f93bad7da47093a12116ff0f390abb548289b600 (patch) | |
| tree | e2a9debcca3473af8f293c3215704549e5bde17f /apps/web/app/api/webhook-config | |
| parent | style: format Go worker with iku (diff) | |
| download | asa.news-f93bad7da47093a12116ff0f390abb548289b600.tar.xz asa.news-f93bad7da47093a12116ff0f390abb548289b600.zip | |
style: lowercase all user-facing strings and add custom eslint rule
Comprehensive sweep of all user-facing text to enforce lowercase
convention, including acronyms (api, rest, http, opml, json, totp,
mfa, qr, hmac). Added asa-lowercase/lowercase-strings eslint rule
that reports uppercase in notify() calls, error messages, jsx text,
and checked attributes (placeholder, alt, title).
Diffstat (limited to 'apps/web/app/api/webhook-config')
| -rw-r--r-- | apps/web/app/api/webhook-config/route.ts | 16 | ||||
| -rw-r--r-- | apps/web/app/api/webhook-config/test/route.ts | 10 |
2 files changed, 13 insertions, 13 deletions
diff --git a/apps/web/app/api/webhook-config/route.ts b/apps/web/app/api/webhook-config/route.ts index 1ce9a30..049f4f3 100644 --- a/apps/web/app/api/webhook-config/route.ts +++ b/apps/web/app/api/webhook-config/route.ts @@ -11,7 +11,7 @@ export async function GET() { } = await supabaseClient.auth.getUser() if (!user) { - return NextResponse.json({ error: "Not authenticated" }, { status: 401 }) + return NextResponse.json({ error: "not authenticated" }, { status: 401 }) } const adminClient = createSupabaseAdminClient() @@ -25,7 +25,7 @@ export async function GET() { if (error || !profile) { return NextResponse.json( - { error: "Failed to load webhook config" }, + { error: "failed to load webhook config" }, { status: 500 } ) } @@ -45,12 +45,12 @@ export async function PUT(request: Request) { } = await supabaseClient.auth.getUser() if (!user) { - return NextResponse.json({ error: "Not authenticated" }, { status: 401 }) + return NextResponse.json({ error: "not authenticated" }, { status: 401 }) } const rateLimitResult = rateLimit(`webhook-config:${user.id}`, 10, 60_000) if (!rateLimitResult.success) { - return NextResponse.json({ error: "Too many requests" }, { status: 429 }) + return NextResponse.json({ error: "too many requests" }, { status: 429 }) } const adminClient = createSupabaseAdminClient() @@ -66,7 +66,7 @@ export async function PUT(request: Request) { !TIER_LIMITS[profile.tier as SubscriptionTier]?.allowsWebhooks ) { return NextResponse.json( - { error: "Webhooks require the developer plan" }, + { error: "webhooks require the developer plan" }, { status: 403 } ) } @@ -79,7 +79,7 @@ export async function PUT(request: Request) { const trimmedUrl = body.webhookUrl.trim() if (trimmedUrl && !trimmedUrl.startsWith("https://")) { return NextResponse.json( - { error: "Webhook URL must use HTTPS" }, + { error: "webhook url must use https" }, { status: 400 } ) } @@ -98,7 +98,7 @@ export async function PUT(request: Request) { } if (Object.keys(updates).length === 0) { - return NextResponse.json({ error: "No updates provided" }, { status: 400 }) + return NextResponse.json({ error: "no updates provided" }, { status: 400 }) } const { error } = await adminClient @@ -108,7 +108,7 @@ export async function PUT(request: Request) { if (error) { return NextResponse.json( - { error: "Failed to update webhook config" }, + { error: "failed to update webhook config" }, { status: 500 } ) } diff --git a/apps/web/app/api/webhook-config/test/route.ts b/apps/web/app/api/webhook-config/test/route.ts index 684ec0c..6171da4 100644 --- a/apps/web/app/api/webhook-config/test/route.ts +++ b/apps/web/app/api/webhook-config/test/route.ts @@ -12,12 +12,12 @@ export async function POST() { } = await supabaseClient.auth.getUser() if (!user) { - return NextResponse.json({ error: "Not authenticated" }, { status: 401 }) + return NextResponse.json({ error: "not authenticated" }, { status: 401 }) } const rateLimitResult = rateLimit(`webhook-test:${user.id}`, 5, 60_000) if (!rateLimitResult.success) { - return NextResponse.json({ error: "Too many requests" }, { status: 429 }) + return NextResponse.json({ error: "too many requests" }, { status: 429 }) } const adminClient = createSupabaseAdminClient() @@ -34,14 +34,14 @@ export async function POST() { !TIER_LIMITS[profile.tier as SubscriptionTier]?.allowsWebhooks ) { return NextResponse.json( - { error: "Webhooks require the developer plan" }, + { error: "webhooks require the developer plan" }, { status: 403 } ) } if (!profile.webhook_url) { return NextResponse.json( - { error: "No webhook URL configured" }, + { error: "no webhook url configured" }, { status: 400 } ) } @@ -53,7 +53,7 @@ export async function POST() { { entryIdentifier: "test-entry-000", feedIdentifier: "test-feed-000", - title: "Test webhook delivery", + title: "test webhook delivery", url: "https://asa.news", author: "asa.news", summary: "This is a test webhook payload to verify your endpoint.", |