Skip to content

Commit

Permalink
Merge pull request #94 from Make-A-Wish-Sopt/release1.0.0
Browse files Browse the repository at this point in the history
[ fix ] 빌드 에러 수정
  • Loading branch information
myeongheonhong committed Aug 23, 2023
2 parents ea1a784 + 27f8f28 commit 9df86bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion api/wishes/getPresignedURL.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PATH from '@/constant/path';
import { client } from '../common/axios';
import PATH from '../common/path';

export const getPresignedURL = async (fileName: string | undefined) => {
const accessToken = localStorage.getItem('accessToken');
Expand Down
10 changes: 3 additions & 7 deletions hooks/wishes/useUploadItemInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useMutation, useQuery } from 'react-query';

export default function useUploadItemInfo() {
const [imageFile, setImageFile] = useState<File | Blob | null>(null);
const [previewImage, setPreviewImage] = useState<string | ArrayBuffer | null>('');
const [previewImage, setPreviewImage] = useState<string | null>('');
const [preSignedURL, setPreSignedURL] = useState('');

const { data } = useQuery(QUERY_KEY.PRE_SIGNED_URL, () => getPresignedURL(imageFile?.name), {
Expand All @@ -19,11 +19,7 @@ export default function useUploadItemInfo() {
}
}, [data]);

const { mutate } = useMutation(() => uploadPresignedURL(data?.data?.data?.signedUrl, imageFile), {
onSuccess: () => {
// setPreSignedURL()
},
});
const { mutate } = useMutation(() => uploadPresignedURL(data?.data?.data?.signedUrl, imageFile));

console.log(data);

Expand All @@ -35,7 +31,7 @@ export default function useUploadItemInfo() {
const reader = new FileReader();
imageFile && reader.readAsDataURL(imageFile);
reader.onloadend = () => {
setPreviewImage(reader.result);
setPreviewImage(reader.result as string);
};
}
}
Expand Down

0 comments on commit 9df86bd

Please sign in to comment.