File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- const db = require ( '../../db' ) ;
1+ import { authorise , reject } from '../../db' ;
2+ import { Action } from './Action' ;
23
3- const attemptAutoApproval = async ( action ) => {
4+ const attemptAutoApproval = async ( action : Action ) => {
45 try {
56 const attestation = {
67 timestamp : new Date ( ) ,
78 autoApproved : true ,
89 } ;
9- await db . authorise ( action . id , attestation ) ;
10+ await authorise ( action . id , attestation ) ;
1011 console . log ( 'Push automatically approved by system.' ) ;
1112
1213 return true ;
13- } catch ( error ) {
14+ } catch ( error : any ) {
1415 console . error ( 'Error during auto-approval:' , error . message ) ;
1516 return false ;
1617 }
1718} ;
1819
19- const attemptAutoRejection = async ( action ) => {
20+ const attemptAutoRejection = async ( action : Action ) => {
2021 try {
2122 const attestation = {
2223 timestamp : new Date ( ) ,
2324 autoApproved : true ,
2425 } ;
25- await db . reject ( action . id , attestation ) ;
26+ await reject ( action . id , attestation ) ;
2627 console . log ( 'Push automatically rejected by system.' ) ;
2728
2829 return true ;
29- } catch ( error ) {
30+ } catch ( error : any ) {
3031 console . error ( 'Error during auto-rejection:' , error . message ) ;
3132 return false ;
3233 }
3334} ;
3435
35- module . exports = {
36+ export {
3637 attemptAutoApproval ,
3738 attemptAutoRejection ,
3839} ;
You can’t perform that action at this time.
0 commit comments