From b58095dbb137411f275a5dc5364410bd1a40cc45 Mon Sep 17 00:00:00 2001 From: bigint Date: Sat, 6 Jan 2024 19:12:00 +0530 Subject: [PATCH] refactor: update api endpoints --- .github/workflows/deploy-api.yml | 2 +- .../railway/{triggerDeployments.ts => trigger-deployments.ts} | 0 .../routes/internal/verified/{updateVerified.ts => update.ts} | 0 .../verified/{updateVerified.spec.ts => update.spec.ts} | 4 ++-- .../components/Staff/Users/Overview/Tool/Access/Verify.tsx | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename apps/api/src/routes/internal/railway/{triggerDeployments.ts => trigger-deployments.ts} (100%) rename apps/api/src/routes/internal/verified/{updateVerified.ts => update.ts} (100%) rename apps/api/tests/internal/verified/{updateVerified.spec.ts => update.spec.ts} (81%) diff --git a/.github/workflows/deploy-api.yml b/.github/workflows/deploy-api.yml index acddfc0cd8c3..6838cdad72f7 100644 --- a/.github/workflows/deploy-api.yml +++ b/.github/workflows/deploy-api.yml @@ -41,4 +41,4 @@ jobs: -H "Content-Type: application/json" \ -H "Referer: https://hey.xyz" \ -d '{"secret": "'"$SECRET"'", "serviceId": "'"$SERVICE_ID"'"}' \ - https://api.hey.xyz/internal/railway/triggerDeployments + https://api.hey.xyz/internal/railway/trigger-deployments diff --git a/apps/api/src/routes/internal/railway/triggerDeployments.ts b/apps/api/src/routes/internal/railway/trigger-deployments.ts similarity index 100% rename from apps/api/src/routes/internal/railway/triggerDeployments.ts rename to apps/api/src/routes/internal/railway/trigger-deployments.ts diff --git a/apps/api/src/routes/internal/verified/updateVerified.ts b/apps/api/src/routes/internal/verified/update.ts similarity index 100% rename from apps/api/src/routes/internal/verified/updateVerified.ts rename to apps/api/src/routes/internal/verified/update.ts diff --git a/apps/api/tests/internal/verified/updateVerified.spec.ts b/apps/api/tests/internal/verified/update.spec.ts similarity index 81% rename from apps/api/tests/internal/verified/updateVerified.spec.ts rename to apps/api/tests/internal/verified/update.spec.ts index 8f56b970ac44..74954355b90b 100644 --- a/apps/api/tests/internal/verified/updateVerified.spec.ts +++ b/apps/api/tests/internal/verified/update.spec.ts @@ -3,10 +3,10 @@ import { TEST_URL } from '@utils/constants'; import axios from 'axios'; import { describe, expect, test } from 'vitest'; -describe('internal/verified/updateVerified', () => { +describe('internal/verified/update', () => { test('should update verified status', async () => { const response = await axios.post( - `${TEST_URL}/internal/verified/updateVerified`, + `${TEST_URL}/internal/verified/update`, { enabled: true, id: Math.random().toString() }, { headers: await getAuthWorkerHeadersForTest() } ); diff --git a/apps/web/src/components/Staff/Users/Overview/Tool/Access/Verify.tsx b/apps/web/src/components/Staff/Users/Overview/Tool/Access/Verify.tsx index 9765e893c07d..8ba361de21d8 100644 --- a/apps/web/src/components/Staff/Users/Overview/Tool/Access/Verify.tsx +++ b/apps/web/src/components/Staff/Users/Overview/Tool/Access/Verify.tsx @@ -23,7 +23,7 @@ const Verify: FC = ({ profileId }) => { const updateVerified = async () => { toast.promise( axios.post( - `${HEY_API_URL}/internal/verified/updateVerified`, + `${HEY_API_URL}/internal/verified/update`, { enabled: !isVerified, id: profileId }, { headers: getAuthWorkerHeaders() } ),