Skip to content

Commit

Permalink
return statuses for multisig session
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosQ96 committed Oct 21, 2023
1 parent 3320572 commit 48b3a95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/entities/multisigSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export enum MultisigStatuses {
Pending = 'pending',
Failed = 'failed',
Successful = 'successful',
NotFound = 'not found',
}

@Entity()
Expand Down
11 changes: 9 additions & 2 deletions src/routes/v1/multisigAuthenticationRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { errorMessagesEnum } from '../../utils/errorMessages';
import { logger } from '../../utils/logger';
import { MultisigAuthenticationController } from '@/src/controllers/v1/multisigAuthenticationController';
import { findNonExpiredMultisigSessions } from '@/src/repositories/multisigSessionRepository';
import { MultisigSession } from '@/src/entities/multisigSession';
import {
MultisigSession,
MultisigStatuses,
} from '@/src/entities/multisigSession';
import moment from 'moment';

export const multisigAuthenticationRouter = express.Router();
Expand Down Expand Up @@ -50,7 +53,11 @@ multisigAuthenticationRouter.get(
Number(network),
);

res.send({ active: multisigSession ? true : false });
res.send({
status: multisigSession
? multisigSession.status
: MultisigStatuses.NotFound,
});
} catch (e) {
logger.error('multisigAuthenticationController() error', e);
next(e);
Expand Down

0 comments on commit 48b3a95

Please sign in to comment.