fix: 링크 저장 및 에러 메시지 개선
- created_at 기본값이 없어도 저장되도록 NOW()로 기록 - API 오류 발생 시 detail을 함께 표시 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user