update descing

This commit is contained in:
Nate Kelley 2025-10-07 17:23:03 -06:00
parent 3b5995f4e8
commit 79d5fba6e3
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
2 changed files with 10 additions and 8 deletions

View File

@ -211,12 +211,14 @@ const MetaContent = ({
<div className="flex flex-wrap gap-1">
{createdBy && (
<PillContainer>
<img
src={createdByAvatarUrl ?? ''}
alt="Avatar"
className="w-3 h-3 rounded-full border object-contain bg-gray-light/50"
style={{ objectFit: 'contain' }}
/>
{createdByAvatarUrl && (
<img
src={createdByAvatarUrl ?? ''}
alt="Avatar"
className="w-3 h-3 rounded-full border object-contain bg-gray-light/50"
style={{ objectFit: 'contain' }}
/>
)}
{createdByName}
</PillContainer>

View File

@ -1,4 +1,4 @@
import { and, eq, gte, inArray, isNull, lte, sql } from 'drizzle-orm';
import { and, desc, eq, gte, inArray, isNull, lte, sql } from 'drizzle-orm';
import { z } from 'zod';
import { db } from '../../connection';
import { assetSearchV2, users } from '../../schema';
@ -126,7 +126,7 @@ export async function searchText(input: SearchTextInput): Promise<SearchTextResp
.orderBy(
sql`CASE WHEN ${assetSearchV2.assetType} = 'metric_file' THEN 1 ELSE 0 END`,
sql`pgroonga_score("asset_search_v2".tableoid, "asset_search_v2".ctid) DESC`,
assetSearchV2.updatedAt
desc(assetSearchV2.updatedAt)
)
.limit(paginationCheckCount)
.offset(offset);