Skip to content

Commit

Permalink
Add storage API for retrieving images
Browse files Browse the repository at this point in the history
  • Loading branch information
Seheon Yu committed Mar 1, 2024
1 parent 4468d69 commit b6e6959
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/redux/features/storage/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { api } from '#/redux/api';

const storageApi = api.injectEndpoints({
endpoints: (build) => ({
getImage: build.query<Blob, string>({
query: (path) => ({
baseUrl: 'https://d2ueefa0uvyh4f.cloudfront.net',
url: path,
method: 'GET',
responseHandler: async (response) => response.blob(),
}),
}),
}),
});

export const { useGetImageQuery } = storageApi;
export default storageApi;

0 comments on commit b6e6959

Please sign in to comment.