Skip to content

Commit

Permalink
feat: hard code filepath
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Zhang (张涛) committed Feb 22, 2024
1 parent 0d0a8ed commit baf797f
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions packages/canyon-backend/src/sourcecode/sourcecode.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,27 @@ export class SourcecodeService {
constructor(private readonly prisma: PrismaService) {}

getsourcecode(projectID, sha, filepath): Promise<any> {
// return this.prisma.''
return getFileInfo(
{
projectID,
filepath: encodeURIComponent(filepath.replace('~/', '')),
commitSha: sha,
},
'accessToken',
);
// 实在不想硬编码
if (projectID === '100807') {
return getFileInfo(
{
projectID,
filepath: encodeURIComponent(
filepath.replace('~/src/taro/pages/tnt', 'src/pages/tnt'),
),
commitSha: sha,
},
'accessToken',
);
} else {
return getFileInfo(
{
projectID,
filepath: encodeURIComponent(filepath.replace('~/', '')),
commitSha: sha,
},
'accessToken',
);
}
}
}

0 comments on commit baf797f

Please sign in to comment.