Skip to content

Commit

Permalink
change download_url to url #1081
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadkitenge committed Nov 21, 2024
1 parent 1e3868a commit 381cff1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/api/api.types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,5 +259,5 @@ export interface Image
}

export interface ImageGet extends Image {
download_url: string;
url: string;
}
2 changes: 1 addition & 1 deletion src/common/images/imageGallery.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const ImageGallery = (props: ImageGalleryProps) => {
queryFn: async () => {
const image = await getImage(imageId);
const img = new Image();
img.src = image.download_url;
img.src = image.url;

await new Promise((resolve, reject) => {
img.onload = resolve;
Expand Down
6 changes: 3 additions & 3 deletions src/mocks/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1036,18 +1036,18 @@ export const handlers = [
if (Number(id) % 2 === 0) {
image = {
...ImagesJSON,
download_url: `${window.location.origin}/logo192.png?text=${encodeURIComponent(id as string)}`,
url: `${window.location.origin}/logo192.png?text=${encodeURIComponent(id as string)}`,
};
} else {
if (Number(id) === 3) {
image = {
...ImagesJSON,
download_url: ImagesJSON[1].file_name,
url: ImagesJSON[1].file_name,
};
} else {
image = {
...ImagesJSON,
download_url: `${window.location.origin}/images/stfc-logo-blue-text.png?text=${encodeURIComponent(id as string)}`,
url: `${window.location.origin}/images/stfc-logo-blue-text.png?text=${encodeURIComponent(id as string)}`,
};
}
}
Expand Down

0 comments on commit 381cff1

Please sign in to comment.