Skip to content

Commit 4ee6b62

Browse files
committed
chore: save reason in DB
1 parent 4ae8abd commit 4ee6b62

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/db/file/pushes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export const authorise = async (id: string, attestation: any): Promise<{ message
112112
return { message: `authorised ${id}` };
113113
};
114114

115-
export const reject = async (id: string, attestation: any): Promise<{ message: string }> => {
115+
export const reject = async (id: string, rejection: any): Promise<{ message: string }> => {
116116
const action = await getPush(id);
117117
if (!action) {
118118
throw new Error(`push ${id} not found`);
@@ -121,7 +121,7 @@ export const reject = async (id: string, attestation: any): Promise<{ message: s
121121
action.authorised = false;
122122
action.canceled = false;
123123
action.rejected = true;
124-
action.attestation = attestation;
124+
action.rejection = rejection;
125125
await writeAudit(action);
126126
return { message: `reject ${id}` };
127127
};

src/db/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ export const deletePush = (id: string): Promise<void> => sink.deletePush(id);
149149
export const authorise = (id: string, attestation: any): Promise<{ message: string }> =>
150150
sink.authorise(id, attestation);
151151
export const cancel = (id: string): Promise<{ message: string }> => sink.cancel(id);
152-
export const reject = (id: string, attestation: any): Promise<{ message: string }> =>
153-
sink.reject(id, attestation);
152+
export const reject = (id: string, rejection: any): Promise<{ message: string }> =>
153+
sink.reject(id, rejection);
154154
export const getRepos = (query?: Partial<RepoQuery>): Promise<Repo[]> => sink.getRepos(query);
155155
export const getRepo = (name: string): Promise<Repo | null> => sink.getRepo(name);
156156
export const getRepoByUrl = (url: string): Promise<Repo | null> => sink.getRepoByUrl(url);

src/db/mongo/pushes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const writeAudit = async (action: Action): Promise<void> => {
6363
await collection.updateOne({ id: data.id }, { $set: data }, options);
6464
};
6565

66-
export const authorise = async (id: string, attestation: any): Promise<{ message: string }> => {
66+
export const authorise = async (id: string, rejection: any): Promise<{ message: string }> => {
6767
const action = await getPush(id);
6868
if (!action) {
6969
throw new Error(`push ${id} not found`);
@@ -72,7 +72,7 @@ export const authorise = async (id: string, attestation: any): Promise<{ message
7272
action.authorised = true;
7373
action.canceled = false;
7474
action.rejected = false;
75-
action.attestation = attestation;
75+
action.rejection = rejection;
7676
await writeAudit(action);
7777
return { message: `authorised ${id}` };
7878
};

src/db/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export interface Sink {
9898
deletePush: (id: string) => Promise<void>;
9999
authorise: (id: string, attestation: any) => Promise<{ message: string }>;
100100
cancel: (id: string) => Promise<{ message: string }>;
101-
reject: (id: string, attestation: any) => Promise<{ message: string }>;
101+
reject: (id: string, rejection: any) => Promise<{ message: string }>;
102102
getRepos: (query?: Partial<RepoQuery>) => Promise<Repo[]>;
103103
getRepo: (name: string) => Promise<Repo | null>;
104104
getRepoByUrl: (url: string) => Promise<Repo | null>;

0 commit comments

Comments
 (0)