Skip to content

Commit 9c81ae3

Browse files
committed
fix(ts): fix TS error
1 parent ab6c6c5 commit 9c81ae3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/db/file/pushes.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,10 @@ export const canUserCancelPush = async (id: string, user: any) => {
108108
const pushDetail = await getPush(id);
109109
if (!pushDetail) {
110110
resolve(false);
111+
return;
111112
}
112113

113-
const repoName = pushDetail?.repoName.replace('.git', '');
114+
const repoName = pushDetail.repoName.replace('.git', '');
114115
const isAllowed = await repo.isUserPushAllowed(repoName, user);
115116

116117
if (isAllowed) {
@@ -126,6 +127,7 @@ export const canUserApproveRejectPush = async (id: string, user: any) => {
126127
const action = await getPush(id);
127128
if (!action) {
128129
resolve(false);
130+
return;
129131
}
130132
const repoName = action?.repoName.replace('.git', '');
131133
const isAllowed = await repo.canUserApproveRejectPushRepo(repoName, user);

0 commit comments

Comments
 (0)