Skip to content

Commit

Permalink
Use Identity instead of randomUUID
Browse files Browse the repository at this point in the history
  • Loading branch information
gruz0 committed Nov 27, 2024
1 parent db1afd0 commit f1c1fb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/api/concepts/[id]/route.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { randomUUID } from 'crypto'
import * as Sentry from '@sentry/nextjs'
import { NextResponse } from 'next/server'
import { App } from '@/concept/service/Service'
import { Identity } from '@/shared/Identity'

export async function POST(_: Request, { params }: { params: { id: string } }) {
Sentry.setTag('component', 'HTTP API')
Sentry.setTag('concept_id', params.id)

try {
const newIdeaId = randomUUID()
const newIdeaId = Identity.Generate().getValue()

Sentry.setTag('idea_id', newIdeaId)

Expand Down
4 changes: 2 additions & 2 deletions src/app/api/concepts/route.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { randomUUID } from 'crypto'
import * as Sentry from '@sentry/nextjs'
import { NextResponse } from 'next/server'
import { App } from '@/concept/service/Service'
import { createIdeaLimiterKey, manager } from '@/lib/rateLimiter'
import { Identity } from '@/shared/Identity'

const createIdeaLimiter = manager.getLimiter(createIdeaLimiterKey)

Expand Down Expand Up @@ -42,7 +42,7 @@ export async function POST(request: Request) {
)
}

const conceptId = randomUUID()
const conceptId = Identity.Generate().getValue()

Sentry.setTag('concept_id', conceptId)

Expand Down

0 comments on commit f1c1fb2

Please sign in to comment.