Skip to content

Commit

Permalink
order by savedAt
Browse files Browse the repository at this point in the history
  • Loading branch information
yxshv committed Apr 13, 2024
1 parent 560363b commit e990414
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/web/src/actions/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export async function fetchContentForSpace(
exists(
db.select().from(contentToSpace).where(and(eq(contentToSpace.spaceId, spaceId), eq(contentToSpace.contentId, storedContent.id))),
),
).orderBy(asc(storedContent.title))
).orderBy(asc(storedContent.savedAt))

return range ? await query.limit(range.limit).offset(range.offset) : await query.all()
}
Expand Down Expand Up @@ -188,7 +188,7 @@ export async function fetchFreeMemories(
eq(storedContent.user, user.id),
)

).orderBy(asc(storedContent.title))
).orderBy(asc(storedContent.savedAt))

return range ? await query.limit(range.limit).offset(range.offset) : await query.all()

Expand Down
2 changes: 0 additions & 2 deletions apps/web/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import {
} from "../../types/memory";
import { MemoryProvider } from "@/contexts/MemoryContext";
import Content from "./content";
import { searchMemoriesAndSpaces } from "@/actions/db";
import { getMetaData } from "@/server/helpers";

export const runtime = "edge";

Expand Down

0 comments on commit e990414

Please sign in to comment.