Skip to content
Merged

Dev #64

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/(afterLogin)/_components/protectedPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function ProtectedPage({ children }: Props) {
};

initializeAuth();
}, []);
}, [isInitialized, router, searchParams, setInitialized, token, checkAuth]);

if (!isInitialized) return null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
} from "@/hooks/useApplications";
import {
ApplicationStatus,
CompanyApplication,
CompanyApplicationWithId,
ScheduleStatus,
typeLabels,
Expand Down Expand Up @@ -147,7 +148,7 @@ export default function EditApplicationsPage({ id }: { id: number }) {

try {
await mutateAsync({
changedApplication: changedApplication,
changedApplication: changedApplication as CompanyApplication,
applicationId: id,
});

Expand Down
36 changes: 17 additions & 19 deletions src/app/(afterLogin)/applications/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Divider from "../documents/_components/divider";
import LoadingSpinner from "@/app/_components/loadingSpinner";
import SearchIcon from "@/assets/Search.svg";
import PlusIcon from "@/assets/Plus.svg";
import { CompanyApplicationWithId, Schedule } from "@/type/applicationType";
import { ApplicationStatus, CompanyApplicationWithId, Schedule } from "@/type/applicationType";
import PencilSimpleIcon from "@/assets/PencilSimple.svg";
import TrashSimpleIcon from "@/assets/TrashSimple.svg";

Expand Down Expand Up @@ -95,7 +95,7 @@ export default function ApplicationsPage() {
alert("선택된 항목이 모두 삭제되었습니다.");
setSelectedIds([]);
refetch();
} catch (error) {
} catch {
alert("일부 항목 삭제에 실패했습니다. 페이지를 새로고침합니다.");
refetch();
}
Expand All @@ -115,26 +115,24 @@ export default function ApplicationsPage() {

const handleStatusChange = (
app: CompanyApplicationWithId,
status: string
newStatus: string
) => {
const changedApp = { ...app, status };
updateMutate(
{ applicationId: app.id, changedApplication: changedApp },
{
onError: () => {
alert("오류가 발생하였습니다. 잠시 후 시도해주세요.");
},
}
);
const queryKey = ["applications", page, searchQuery];
updateMutate({
applicationId: app.id,
changedApplication: { ...app, status: newStatus as ApplicationStatus },
queryKey: queryKey,
newStatus: newStatus,
});
};

const formatUrl = (url?: string) => {
if (!url) return "";
if (url.startsWith("http://") || url.startsWith("https://")) {
return url;
}
return `https://${url}`;
};
// const formatUrl = (url?: string) => {
// if (!url) return "";
// if (url.startsWith("http://") || url.startsWith("https://")) {
// return url;
// }
// return `https://${url}`;
// };

return (
<>
Expand Down

This file was deleted.

80 changes: 0 additions & 80 deletions src/app/(afterLogin)/dashboard/_components/scheduleSection.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
"use client";

import PlusCircleIcon from "@/assets/PlusCircle.svg";
import Divider from "../../_components/divider";
import DownloadIcon from "@/assets/Download.svg";
import UploadIcon from "@/assets/Upload.svg";
import Link from "next/link";
import { useDocumentStore } from "@/store/documents/documentStore";
import { ApplicationStatus, Document } from "@/type/applicationType";
import { DocumentType } from "@/type/documentType";
Expand Down Expand Up @@ -75,8 +72,7 @@ export default function DocumentDescription({

link.parentNode?.removeChild(link);
window.URL.revokeObjectURL(blobUrl);
} catch (error) {
console.error("Download error:", error);
} catch {
alert("파일 다운로드 중 오류가 발생했습니다.");
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/app/(afterLogin)/documents/_components/mainDocuments.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { useState, useRef, useEffect } from "react";
import { useState, useRef, useEffect, useMemo } from "react";
import { formatDate } from "date-fns";
import { useCreateDocument, useDocuments } from "@/hooks/useDocuments";
import VersionBadge from "./versionBadge";
Expand All @@ -16,7 +16,7 @@ import UploadFileButton from "./uploadFileButton";
export default function MainDocuments() {
const [page, setPage] = useState(0);
const { data, error, isLoading } = useDocuments(page);
const documents = data?.data?.data.content ?? [];
const documents = useMemo(() => data?.data.data.content || [], [data?.data.data.content]);
const router = useRouter();

const [isAdding, setIsAdding] = useState(false);
Expand Down
Loading