Skip to content

Commit bc068d1

Browse files
authored
fix: only get packageId from database (#768)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Enhanced the internal process for retrieving package version details, resulting in more accurate and reliable version information. - Streamlined the handling of missing package data to reduce unexpected issues. - Optimized overall data processing, contributing to improved stability and a smoother user experience. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 9ffb09e commit bc068d1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/core/service/PackageVersionService.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ export class PackageVersionService {
125125

126126
async findBlockInfo(fullname: string) {
127127
const [ scope, name ] = getScopeAndName(fullname);
128-
const pkg = await this.packageRepository.findPackage(scope, name);
129-
if (!pkg) {
128+
const packageId = await this.packageRepository.findPackageId(scope, name);
129+
if (!packageId) {
130130
return null;
131131
}
132-
return await this.packageVersionBlockRepository.findPackageBlock(pkg.packageId);
132+
return await this.packageVersionBlockRepository.findPackageBlock(packageId);
133133
}
134134
}

0 commit comments

Comments
 (0)