Compare commits

..

No commits in common. "2d5763ac02d3c3d2e40f2908e55d124267d6bc77" and "1d8b99fe8efae522b75ff763bea5ddbeff845cd6" have entirely different histories.

3 changed files with 3 additions and 6 deletions

View File

@ -3,7 +3,6 @@ import {
IsOptional, IsOptional,
IsString, IsString,
IsUrl, IsUrl,
Matches,
MaxLength, MaxLength,
MinLength, MinLength,
} from 'class-validator'; } from 'class-validator';
@ -20,9 +19,7 @@ export class CreateProjectInput {
@MinLength(2) @MinLength(2)
comment: string; comment: string;
@Matches( @IsUrl({ protocols: ['ssh'] })
/^(?:ssh:\/\/)?(?:[\w\d-_]+@)(?:[\w\d-_]+\.)*\w{2,10}(?::\d{1,5})?(?:\/[\w\d-_.]+)*/,
)
@MaxLength(256) @MaxLength(256)
sshUrl: string; sshUrl: string;

View File

@ -13,7 +13,7 @@ export class ReposResolver {
return await this.service.listLogs(dto); return await this.service.listLogs(dto);
} }
@Query(() => BranchList) @Query(() => BranchList)
async listBranches( async ListBranchesArgs(
@Args('listBranchesArgs') dto: ListBranchesArgs, @Args('listBranchesArgs') dto: ListBranchesArgs,
): Promise<BranchList> { ): Promise<BranchList> {
return await this.service.listBranches(dto).then((data) => { return await this.service.listBranches(dto).then((data) => {

View File

@ -31,7 +31,7 @@ export class ReposService {
// TODO: 获取锁,失败抛错。 // TODO: 获取锁,失败抛错。
} }
async getGit(project: Project, subDir = 'default') { async getGit(project: Project, subDir?: string) {
const workspaceRoot = this.getWorkspaceRoot(project, subDir); const workspaceRoot = this.getWorkspaceRoot(project, subDir);
await this.lockWorkspace(workspaceRoot); await this.lockWorkspace(workspaceRoot);