Skip to content

Commit

Permalink
add env en default file
Browse files Browse the repository at this point in the history
  • Loading branch information
Jugurtha Bouhadoun committed Oct 30, 2024
1 parent 8451968 commit 88a026f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env.default
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NEXT_PUBLIC_ADRESSE_URL=http://localhost:3000
NEXT_PUBLIC_API_BAN_URL=https://plateforme.adresse.data.gouv.fr

BAN_API_TOKEN=YOUR_BAN_API_TOKEN
# -----------------------------
# Application configuration ---
# -----------------------------
Expand Down
6 changes: 4 additions & 2 deletions src/app/api/certificat/[idAdresse]/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { getAddress, getDistrict } from '@/lib/api-ban'
import QRCode from 'qrcode'
import { getMairie } from '@/lib/api-etablissement-public'

const { NEXT_PUBLIC_ADRESSE_URL, NEXT_PUBLIC_API_BAN_URL } = process.env
const { BAN_API_TOKEN } = process.env
const NEXT_PUBLIC_ADRESSE_URL = process.env.NEXT_PUBLIC_ADRESSE_URL
const NEXT_PUBLIC_API_BAN_URL = process.env.NEXT_PUBLIC_API_BAN_URL
const BAN_API_TOKEN = process.env.BAN_API_TOKEN

const isAddressCertifiable = async ({ banId, sources, certifie, parcelles }: any): Promise<boolean> => {
return !!banId && sources?.includes('bal') && certifie && parcelles?.length > 0
Expand Down Expand Up @@ -46,6 +47,7 @@ export async function GET(request: NextRequest, { params }: { params: { idAdress
}

const { banId: addressID } = address
console.log(`${NEXT_PUBLIC_API_BAN_URL}/api/certificate/`)
const response = await fetch(`${NEXT_PUBLIC_API_BAN_URL}/api/certificate/`, {
method: 'POST',
headers: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Document/numerotation/certificat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@react-pdf/renderer'
import { stylesDSFR } from './certificat.styles'

const { NEXT_PUBLIC_ADRESSE_URL } = process.env
const NEXT_PUBLIC_ADRESSE_URL = process.env.NEXT_PUBLIC_ADRESSE_URL

interface CertificatNumerotationProps {
data: {
Expand Down

0 comments on commit 88a026f

Please sign in to comment.