Skip to content

Commit

Permalink
order public themes by created date
Browse files Browse the repository at this point in the history
  • Loading branch information
RodrigoLuglio committed Oct 15, 2024
1 parent 0427244 commit 5ca7ce7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/db/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { revalidatePath } from 'next/cache'
import { ColorScheme, type SavedTheme, SavedThemeSchema } from '../types/colors'
import { db } from '../drizzle/db'
import { ThemesTable, UsersTable } from '../drizzle/schema'
import { eq } from 'drizzle-orm'
import { desc, eq } from 'drizzle-orm'
import { generateVSIX } from '@/lib/generator/exportVSIX'
import { sql } from '@vercel/postgres'

Expand All @@ -13,6 +13,7 @@ export async function getPublicThemes(): Promise<SavedTheme[]> {
.select()
.from(ThemesTable)
.where(eq(ThemesTable.public, true))
.orderBy(desc(ThemesTable.createdAt))

return results.map(parseSavedTheme)
}
Expand Down

0 comments on commit 5ca7ce7

Please sign in to comment.