Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix image path #24

Merged
merged 4 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading