Skip to content

Commit

Permalink
Merge pull request #733 from ckpaliwal/releasenote-20240611
Browse files Browse the repository at this point in the history
bump change log
  • Loading branch information
ckpaliwal authored Jun 11, 2024
2 parents ec60e15 + 5887916 commit 02ec62d
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions packages/athena/routes/signature_collection_apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
//------------------------------------------------------------
// Signature Collection API Routes
//------------------------------------------------------------
// import { getSigCollectionsMock } from '../../mockServices/mockResponses';
const mocks = require('../../mockServices/mockResponses/signatureCollection');

module.exports = (logger, ev, t) => {
const app = t.express.Router();

Expand All @@ -32,24 +35,27 @@ module.exports = (logger, ev, t) => {
});

function getSigCollections(req, res) {
if (t.ot_misc.is_v2plus_route(req)) {
req._validate_path = '/ak/api/' + t.validate.pick_ver(req) + '/signature_collections';
logger.debug('[pre-flight] setting validate route:', req._validate_path);
}
console.log('request received');
console.log('getSigCollectionsMock', mocks.getSigCollectionsMock);
return res.status(200).json(mocks.getSigCollectionsMock);
// if (t.ot_misc.is_v2plus_route(req)) {
// req._validate_path = '/ak/api/' + t.validate.pick_ver(req) + '/signature_collections';
// logger.debug('[pre-flight] setting validate route:', req._validate_path);
// }

t.validate.request(req, res, t.validate.query_filter_orderers, () => {
t.signature_collection_lib.getSignatureCollections(req, (err, ret) => {
if (err) {
return res.status(t.ot_misc.get_code(err)).json(err);
} else {
let code = 200;
if (t.signature_collection_lib.group_query_param_is_set(req)) {
code = 210; // the group by channels param uses a different response format, identified by the 210 code
}
return res.status(code).json(ret);
}
});
});
// t.validate.request(req, res, t.validate.query_filter_orderers, () => {
// t.signature_collection_lib.getSignatureCollections(req, (err, ret) => {
// if (err) {
// return res.status(t.ot_misc.get_code(err)).json(err);
// } else {
// let code = 200;
// if (t.signature_collection_lib.group_query_param_is_set(req)) {
// code = 210; // the group by channels param uses a different response format, identified by the 210 code
// }
// return res.status(code).json(ret);
// }
// });
// });
}

//--------------------------------------------------
Expand Down

0 comments on commit 02ec62d

Please sign in to comment.