From f036d7458243dabce0560594f162262193c161d9 Mon Sep 17 00:00:00 2001 From: Dmitriy Date: Thu, 25 Apr 2024 15:28:41 +0300 Subject: [PATCH 1/3] refactor: updated files configuration --- apps/server/.env.docker.example | 1 - apps/server/src/utils/email/sendEmail.ts | 12 ------------ docker-compose.local.example.yml | 9 --------- docker-compose.prod-ci.yml | 1 - 4 files changed, 23 deletions(-) diff --git a/apps/server/.env.docker.example b/apps/server/.env.docker.example index 4ab63fc6..05e3aaff 100644 --- a/apps/server/.env.docker.example +++ b/apps/server/.env.docker.example @@ -4,7 +4,6 @@ APP_API=api APP_TRPC=trpc APP_SWAGER=api-docs APP_STATIC_ASSETS=public -APP_SSL_FOLDER= APP_BASE_URL=https://server.fixlab.pp.ua APP_ADMIN_URL=https://admin.fixlab.pp.ua diff --git a/apps/server/src/utils/email/sendEmail.ts b/apps/server/src/utils/email/sendEmail.ts index a21a9bdc..c0bfc39a 100644 --- a/apps/server/src/utils/email/sendEmail.ts +++ b/apps/server/src/utils/email/sendEmail.ts @@ -51,15 +51,3 @@ export const sendEmail = async ({ console.log(error); } }; - -/* -Example: -sendEmail( - "youremail@gmail.com, - "Email subject", - { name: "Eze" }, - "./templates/layouts/main.handlebars" -); -*/ - -// module.exports = sendEmail; diff --git a/docker-compose.local.example.yml b/docker-compose.local.example.yml index 32c73ad5..d2f220f1 100644 --- a/docker-compose.local.example.yml +++ b/docker-compose.local.example.yml @@ -65,22 +65,13 @@ services: env_file: ./apps/server/.env.docker environment: - NODE_ENV=production - - DATABASE_USERNAME= - - DATABASE_PASSWORD= - - DATABASE_NAME= - - DATABASE_URL= - - JWT_SECRET_KEY= - - JWT_REFRESH_TOKEN_KEY= volumes: - ./apps/server/public:/app/apps/server/public - - ./nginx/data:/app/nginx/data - /app/node_modules - /app/apps/server/node_modules - ports: - 30000:3000 networks: - - client - backend depends_on: - mongo diff --git a/docker-compose.prod-ci.yml b/docker-compose.prod-ci.yml index 5cad0859..d880aa4c 100644 --- a/docker-compose.prod-ci.yml +++ b/docker-compose.prod-ci.yml @@ -76,7 +76,6 @@ services: - NODE_ENV=production volumes: - ./server/public/:/app/server/public - - ./nginx/data:/app/nginx/data ports: - 3000:3000 networks: From 09fc9e066f0541d6f082f2b83c6c8d7f1ba96ac0 Mon Sep 17 00:00:00 2001 From: Dmitriy Date: Thu, 25 Apr 2024 15:46:11 +0300 Subject: [PATCH 2/3] refactor: delet uuid from image file name --- apps/server/src/helpers/file-storage.helper.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/server/src/helpers/file-storage.helper.ts b/apps/server/src/helpers/file-storage.helper.ts index 038a3a9d..5673d857 100644 --- a/apps/server/src/helpers/file-storage.helper.ts +++ b/apps/server/src/helpers/file-storage.helper.ts @@ -1,21 +1,20 @@ import multer, { diskStorage } from 'multer'; import * as path from 'path'; -import { v4 as uuidv4 } from 'uuid'; import { PUBLIC_FOLDER } from '@constants/routes.constants'; export const FileStorageHelper = ( - subfolder: string | undefined | null + subfolder: string | undefined | null, ): multer.StorageEngine => { return diskStorage({ destination: `./${PUBLIC_FOLDER}/${subfolder ?? ''}`, filename: (_req, file, cb) => { const filename = `${path .parse(file.originalname) - .name.replace(/\s/g, '')}${uuidv4()}`; + .name.replace(/\s/g, '')}`; const extension = path.parse(file.originalname).ext.toLocaleLowerCase(); cb(null, `${filename}${extension}`); - } + }, }); }; From f282bb14987189ca2c3ff5ac4ebd7c1e1dee779e Mon Sep 17 00:00:00 2001 From: Dmitriy Date: Thu, 25 Apr 2024 15:49:10 +0300 Subject: [PATCH 3/3] refactor: delete consolelog --- apps/admin/app/(pages)/benefits/(components)/AddBenefitForm.tsx | 1 - apps/admin/app/(pages)/benefits/(components)/EditBenefitForm.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/apps/admin/app/(pages)/benefits/(components)/AddBenefitForm.tsx b/apps/admin/app/(pages)/benefits/(components)/AddBenefitForm.tsx index a996ac3f..96872b19 100644 --- a/apps/admin/app/(pages)/benefits/(components)/AddBenefitForm.tsx +++ b/apps/admin/app/(pages)/benefits/(components)/AddBenefitForm.tsx @@ -117,7 +117,6 @@ const AddBenefitForm = ({ iconsData }: any) => { onSubmit={handleSubmit} > {(props: FormikProps) => { - console.log(props.values.file) return (
{ { setSubmitting }: FormikHelpers, ) => { setSubmitting(true) - console.log(selectedIcon, values.file) try { if (selectedIcon) { await updateBenefit.mutateAsync({