Skip to content

Commit

Permalink
perf: ⚡️ tag/folder 查询返回增加 image 排序
Browse files Browse the repository at this point in the history
  • Loading branch information
meetqy committed Jun 21, 2023
1 parent 9a6d1f3 commit 5b190c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/curd/src/folder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export function Folder(this: PrismaClient) {
include: {
images: {
take: 1,
orderBy: { lastTime: "desc" },
},
_count: {
select: { images: true },
Expand Down
4 changes: 4 additions & 0 deletions packages/curd/src/tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export function Tag(this: PrismaClient) {
OR: [{ libraryId: typeof library === "number" ? library : undefined }, { library: { name: library.toString() } }],
},
include: {
images: {
take: 1,
orderBy: { lastTime: "desc" },
},
_count: {
select: { images: true },
},
Expand Down

0 comments on commit 5b190c1

Please sign in to comment.