fix: 링크 저장 및 에러 메시지 개선

- created_at 기본값이 없어도 저장되도록 NOW()로 기록
- API 오류 발생 시 detail을 함께 표시

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dsyoon
2026-02-08 11:43:03 +09:00
parent d076e08e27
commit 7df7c35434
2 changed files with 6 additions and 3 deletions

View File

@@ -118,7 +118,8 @@ async function loadNextPage() {
const res = await fetch(`/links?limit=${PAGE_SIZE}&offset=${nextOffset}`);
const data = await res.json();
if (!res.ok) {
throw new Error(data.error || "링크를 불러오지 못했습니다.");
const detail = data?.detail ? ` (${data.detail})` : "";
throw new Error((data.error || "링크를 불러오지 못했습니다.") + detail);
}
const items = Array.isArray(data) ? data : data.items || [];
@@ -164,7 +165,8 @@ linkForm.addEventListener("submit", async (event) => {
});
const data = await res.json();
if (!res.ok) {
throw new Error(data.error || "저장에 실패했습니다.");
const detail = data?.detail ? ` (${data.detail})` : "";
throw new Error((data.error || "저장에 실패했습니다.") + detail);
}
resetPagination();