Skip to content

Commit

Permalink
Merge pull request #24 from dmytro-komlyk/development
Browse files Browse the repository at this point in the history
Fix image path
  • Loading branch information
dmytro-komlyk authored Apr 26, 2024
2 parents 65f99a0 + a2d482f commit d1bbcff
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ const AddBenefitForm = ({ iconsData }: any) => {
onSubmit={handleSubmit}
>
{(props: FormikProps<any>) => {
console.log(props.values.file)
return (
<Form
onSubmit={props.handleSubmit}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ const EditBenefitForm = ({ benefitData }: { benefitData: IBenefit }) => {
{ setSubmitting }: FormikHelpers<any>,
) => {
setSubmitting(true)
console.log(selectedIcon, values.file)
try {
if (selectedIcon) {
await updateBenefit.mutateAsync({
Expand Down
1 change: 0 additions & 1 deletion apps/server/.env.docker.example
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 3 additions & 4 deletions apps/server/src/helpers/file-storage.helper.ts
Original file line number Diff line number Diff line change
@@ -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}`);
}
},
});
};
12 changes: 0 additions & 12 deletions apps/server/src/utils/email/sendEmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,3 @@ export const sendEmail = async ({
console.log(error);
}
};

/*
Example:
sendEmail(
"[email protected],
"Email subject",
{ name: "Eze" },
"./templates/layouts/main.handlebars"
);
*/

// module.exports = sendEmail;
9 changes: 0 additions & 9 deletions docker-compose.local.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion docker-compose.prod-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ services:
- NODE_ENV=production
volumes:
- ./server/public/:/app/server/public
- ./nginx/data:/app/nginx/data
ports:
- 3000:3000
networks:
Expand Down

0 comments on commit d1bbcff

Please sign in to comment.