Skip to content

Commit

Permalink
Merge pull request #49 from AplinkosMinisterija/48-login-image-fix
Browse files Browse the repository at this point in the history
vite config fix
  • Loading branch information
dovilemely authored Apr 12, 2024
2 parents 0be3869 + a5da2d5 commit caeca84
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ VITE_MAPS_HOST=https://maps.biip.lt
VITE_SENTRY_DSN=
VITE_SENTRY_ENV=
VITE_PROXY_URL=https://uetk.biip.lt/api
VITE_BASE_URL=/app
3 changes: 2 additions & 1 deletion src/utils/functions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
SubPoolTypes
} from "./constants";
import { validationTexts } from "./texts";
const env = import.meta.env;

export const handleErrorFromServerToast = (responseError?: string) => {
toast.error(
Expand Down Expand Up @@ -188,7 +189,7 @@ export const useGetSortedColumns = (columns: Columns) => {
return sortedColumns;
};

export const getPublicUrl = (url: string) => `/${url}`;
export const getPublicUrl = (url: string) => `${env.VITE_BASE_URL}/${url}`;

export const availableMimeTypes = [
"image/png",
Expand Down
1 change: 1 addition & 0 deletions vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default () => {
base: env.VITE_BASE_URL,
server: {
proxy: {
open: '/app',
'/api': {
target: env.VITE_PROXY_URL,
changeOrigin: true,
Expand Down

0 comments on commit caeca84

Please sign in to comment.