Skip to content

Commit

Permalink
앨범 커버 오류 디버깅
Browse files Browse the repository at this point in the history
  • Loading branch information
ipcgrdn committed Dec 22, 2024
1 parent 17cfc72 commit 5d30136
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/modal/album-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ import { IconDisc } from "@tabler/icons-react";
import { zodResolver } from "@hookform/resolvers/zod";
import useAlbumModal from "@/hooks/modal/use-album-modal";
import { api } from "@/lib/axios";
import { useRouter } from "next/navigation";

const AlbumModal = () => {
const [stage, setStage] = useState(1);
const [files, setFiles] = useState<File[]>([]);
const [previewImage, setPreviewImage] = useState<string | null>(null);
const [isLoading, setIsloading] = useState(false);

const router = useRouter();
const albumModal = useAlbumModal();

const handleFileUpload = (files: File[]) => {
Expand Down Expand Up @@ -123,6 +125,7 @@ const AlbumModal = () => {
toast.success("앨범이 생성되었습니다!");
reset();
albumModal.onClose();
router.refresh();
} catch (error) {
if (axios.isAxiosError(error) && error.response?.data) {
const errorData = error.response.data;
Expand Down
3 changes: 3 additions & 0 deletions src/components/modal/profileEdit-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ import { Textarea } from "../ui/textarea";
import { CustomModal } from "./custom-modal";
import { api } from "@/lib/axios";
import { useProfile } from "@/provider/profileProvider";
import { useRouter } from "next/navigation";

const ProfileEditModal = () => {
const [file, setFile] = useState<File | null>(null);
const [isLoading, setIsloading] = useState(false);
const profileEditModal = useProfileEditModal();
const router = useRouter();

const { uuid } = useProfile();

Expand Down Expand Up @@ -180,6 +182,7 @@ const ProfileEditModal = () => {
toast.success("프로필이 수정되었습니다.");
reset();
profileEditModal.onClose();
router.refresh();
};

const handleError = (error: unknown) => {
Expand Down
3 changes: 3 additions & 0 deletions src/services/albumService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export const getAllAlbums = async (
pageSize,
},
});

console.log(response.data);

return response.data;
} catch (error) {
if (axios.isAxiosError(error)) {
Expand Down

0 comments on commit 5d30136

Please sign in to comment.