Skip to content

Commit 85dcb04

Browse files
committed
✨ Recency sort now sorts by created_at for translations
1 parent 7aee92e commit 85dcb04

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

components/jargon/translation-list.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface TranslationListItem {
99
id: string;
1010
name: string;
1111
author_id: string;
12-
updated_at?: string;
12+
created_at?: string;
1313
llm_rank?: number | null;
1414
}
1515

@@ -24,8 +24,8 @@ export default function TranslationList({
2424
const copy = [...translations];
2525
if (sort === "recent") {
2626
copy.sort((a, b) => {
27-
const aTime = a.updated_at ?? "";
28-
const bTime = b.updated_at ?? "";
27+
const aTime = a.created_at ?? "";
28+
const bTime = b.created_at ?? "";
2929
return bTime.localeCompare(aTime);
3030
});
3131
} else if (sort === "abc") {

components/jargon/translation-sort-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default function TranslationSortButton({
4040
>
4141
<DropdownMenuRadioItem value="llm">AI 추천순</DropdownMenuRadioItem>
4242
<DropdownMenuRadioItem value="recent">
43-
최근 활동순
43+
최근 등록순
4444
</DropdownMenuRadioItem>
4545
<DropdownMenuRadioItem value="abc">가나다순</DropdownMenuRadioItem>
4646
{/* <DropdownMenuRadioItem value="zyx">하파카순</DropdownMenuRadioItem> */}

lib/supabase/repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const QUERIES = {
3535
return supabase
3636
.from("jargon")
3737
.select(
38-
"id, name, slug, created_at, author_id, translations:translation(id, name, author_id, updated_at, llm_rank), categories:jargon_category(category:category(id, name, acronym))",
38+
"id, name, slug, created_at, author_id, translations:translation(id, name, author_id, created_at, llm_rank), categories:jargon_category(category:category(id, name, acronym))",
3939
)
4040
.eq("slug", slug)
4141
.limit(1)

0 commit comments

Comments
 (0)