Skip to content

Commit

Permalink
fix: schemaId changed from params to body
Browse files Browse the repository at this point in the history
Signed-off-by: vikastc <[email protected]>
  • Loading branch information
Vikastc committed Mar 20, 2024
1 parent cbc7556 commit 730d9b0
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 730d9b0

Please sign in to comment.