Fix photo URLs

This commit is contained in:
Mikkel Svartveit 2023-10-17 22:40:31 -07:00
parent d8fb432578
commit 85c3b6174b

View file

@ -16,7 +16,9 @@ const sortFiles = (a: any, b: any) => {
export const getFileNameFromPath = (path: string) => {
const parts = path.split("/");
return parts[parts.length - 1].split("?")[0];
const fileName = parts[parts.length - 1].split("?")[0];
const fileNameParts = fileName.split(".");
return fileNameParts[0] + "." + fileNameParts[fileNameParts.length - 1];
};
---