Skip to content

Commit

Permalink
Merge pull request #36 from Vikastc/route-err
Browse files Browse the repository at this point in the history
fix: schemaId changed from params to body
  • Loading branch information
Vikastc authored Mar 20, 2024
2 parents cbc7556 + 730d9b0 commit 35b50a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/controller/credential_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function issueVC(req: express.Request, res: express.Response) {
try {
const schema = await getConnection()
.getRepository(Schema)
.findOne({ identifier: req.params.id });
.findOne({ identifier: data.schemaId });

const parsedSchema = JSON.parse(schema?.cordSchema as string);

Expand Down Expand Up @@ -78,7 +78,7 @@ export async function issueVC(req: express.Request, res: express.Response) {
console.log(`✅ Statement element registered - ${statement}`);

const cred = new Cred();
cred.schemaId = req.params.id;
cred.schemaId = data.schemaId;
cred.identifier = vc.proof[1].identifier;
cred.active = true;
cred.fromDid = issuerDid.uri;
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ app.use(express.json());
const credentialRouter = express.Router({ mergeParams: true });
const schemaRouter = express.Router({ mergeParams: true });

credentialRouter.post('/:id', async (req, res) => {
credentialRouter.post('/', async (req, res) => {
return await issueVC(req, res);
});

Expand Down

0 comments on commit 35b50a3

Please sign in to comment.