Skip to content

Commit

Permalink
[TM-1308] Add metadata to image (#500)
Browse files Browse the repository at this point in the history
* [TM-1308] update endpoint reference for exporting images

* [TM-1308] add file name when downloading image
  • Loading branch information
cesarLima1 authored Sep 23, 2024
1 parent 9d0f6ba commit 301c5d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/elements/ImageGallery/ImageGalleryItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const ImageGalleryItem: FC<ImageGalleryItemProps> = ({
try {
const response = await mutateAsync({
body: {
imageUrl: data.fullImageUrl
uuid: data.uuid
}
});

Expand All @@ -107,7 +107,7 @@ const ImageGalleryItem: FC<ImageGalleryItemProps> = ({

const link = document.createElement("a");
link.href = url;
link.download = "image.jpg";
link.download = data?.raw?.file_name ? data?.raw?.file_name : "image.jpg";
document.body.appendChild(link);
link.click();

Expand Down
2 changes: 1 addition & 1 deletion src/generated/apiComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29769,7 +29769,7 @@ export type PostV2ExportImageRequestBody = {
/**
* The URL of the image to be downloaded.
*/
imageUrl: string;
uuid: string;
};

export type PostV2ExportImageVariables = {
Expand Down

0 comments on commit 301c5d3

Please sign in to comment.