优化资源查询

This commit is contained in:
2025-05-07 18:17:37 +08:00
parent 298272fc70
commit b1fbf062e0
2 changed files with 6 additions and 4 deletions

View File

@@ -34,7 +34,4 @@ export class Resource {
@UpdateDateColumn({ precision: 3 }) @UpdateDateColumn({ precision: 3 })
updatedAt: Date; updatedAt: Date;
@DeleteDateColumn({ nullable: true, precision: 3 })
deletedAt: Date;
} }

View File

@@ -11,6 +11,11 @@ export class ResourceService {
) { } ) { }
async findAll(): Promise<Resource[]> { async findAll(): Promise<Resource[]> {
return this.resourceRepository.find(); return this.resourceRepository.find({
where: { isHidden: false },
order: {
createdAt: 'DESC',
}
});
} }
} }