From ec99154fde9ce6a2909b6f3259c1a5dafeca1d82 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrian=20Or=C5=82=C3=B3w?= <adrian.orlow@fishbrain.com>
Date: Tue, 24 Oct 2023 13:03:18 +0200
Subject: [PATCH] fix: make zod seed an env

---
 .env                   | 1 +
 next.config.js         | 2 +-
 src/constants/index.ts | 4 +++-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/.env b/.env
index 9ed14ae7..3f191e1f 100644
--- a/.env
+++ b/.env
@@ -2,3 +2,4 @@
 NEXT_PUBLIC_BASE_API_URL = 'https://corsproxy.io/?https://lux1.atcomp.pl/minerva/api'
 NEXT_PUBLIC_BASE_NEW_API_URL = 'https://corsproxy.io/?https://lux1.atcomp.pl/minerva/new_api/'
 NEXT_PUBLIC_PROJECT_ID = 'pdmap_appu_test'
+ZOD_SEED = 997
diff --git a/next.config.js b/next.config.js
index 1b307ecc..eebeaf4d 100644
--- a/next.config.js
+++ b/next.config.js
@@ -8,7 +8,7 @@ const nextConfig = {
     BASE_API_URL: process.env.NEXT_PUBLIC_BASE_API_URL || '',
     BASE_MAP_IMAGES_URL: process.env.BASE_MAP_IMAGES_URL || '',
     PROJECT_ID: process.env.NEXT_PUBLIC_PROJECT_ID || '',
-    ZOD_SEED: 997,
+    ZOD_SEED: process.env.ZOD_SEED || 123,
   },
 };
 
diff --git a/src/constants/index.ts b/src/constants/index.ts
index ab67ce6a..e85e24dc 100644
--- a/src/constants/index.ts
+++ b/src/constants/index.ts
@@ -1,7 +1,9 @@
+/* eslint-disable no-magic-numbers */
+
 export const BASE_API_URL = process.env.NEXT_PUBLIC_BASE_API_URL || '';
 export const BASE_MAP_IMAGES_URL = process.env.BASE_MAP_IMAGES_URL || '';
 export const BASE_NEW_API_URL = process.env.NEXT_PUBLIC_BASE_NEW_API_URL || '';
 export const PROJECT_ID = process.env.NEXT_PUBLIC_PROJECT_ID || '';
-export const ZOD_SEED = 997;
+export const ZOD_SEED = parseInt(process.env.ZOD_SEED || '123', 10);
 export const BIO_ENTITY = 'bioEntity';
 export const DRUGS_CHEMICALS_MIRNA = ['drugs', 'chemicals', 'mirna'];
-- 
GitLab