⚙️ Fix get baseUrl for api.

This commit is contained in:
pheralb
2023-12-16 22:35:25 +00:00
parent 099de90f6d
commit e78b4e0f7f
3 changed files with 23 additions and 29 deletions
+1 -21
View File
@@ -1,26 +1,6 @@
import type { iSVG } from '@/types/svg';
import { svgs } from './svgs';
import { getBaseUrl } from '@/utils/getBaseUrl';
export const svgsData = svgs.map((svg: iSVG, index: number) => {
return { id: index, ...svg };
});
export const fullRouteSvgsData: iSVG[] = svgsData.map((svg) => {
const url = getBaseUrl();
if (typeof svg.route === 'object' && svg.route !== null) {
return {
...svg,
route: {
light: `${url}${svg.route.light}`,
dark: `${url}${svg.route.dark}`
}
};
} else if (typeof svg.route === 'string') {
return {
...svg,
route: `${url}${svg.route}`
};
}
return svg;
});
});