Skip to content

Commit

Permalink
feat: optimize images
Browse files Browse the repository at this point in the history
  • Loading branch information
taga3s committed Sep 2, 2024
1 parent 2a8f6e4 commit 3e7a8a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/api/photos/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Response = {
const fetchPhotos = async (c: Context) => {
const res = await apiClient.GET<Response>(c, "/photos");
return res.contents.map((content) => {
return { title: content.title, ...content.image };
return { ...content.image, title: content.title, url: `${content.image.url}?w=1000&q=90` };
});
};

Expand Down
2 changes: 1 addition & 1 deletion app/api/works/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type Response = {
const fetchWorks = async (c: Context) => {
const res = await apiClient.GET<Response>(c, "/works");
return res.contents.map((content) => {
return { ...content };
return { ...content, image: { ...content.image, url: `${content.image.url}?w=1000&q=90` } };
});
};

Expand Down

0 comments on commit 3e7a8a7

Please sign in to comment.