Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
22_23-J 16
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
22_23-J 16
22_23-J 16
Commits
20d49274
Commit
20d49274
authored
Apr 15, 2023
by
Ishini Kiridena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RSA key on NFT request
parent
02ac2865
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
46 deletions
+3
-46
ExpressBackend/model/stellar/nftRequests.js
ExpressBackend/model/stellar/nftRequests.js
+1
-0
ExpressBackend/route/practitioner-routes/requestnft-route.js
ExpressBackend/route/practitioner-routes/requestnft-route.js
+2
-46
No files found.
ExpressBackend/model/stellar/nftRequests.js
View file @
20d49274
...
...
@@ -4,6 +4,7 @@ const NFTRequest = new mongoose.Schema({
assetcode
:
String
,
requesterpk
:
String
,
issuerpk
:
String
,
requesterrsa
:
String
,
status
:
String
,
});
...
...
ExpressBackend/route/practitioner-routes/requestnft-route.js
View file @
20d49274
...
...
@@ -11,6 +11,7 @@ router.post("/", async (req, res) => {
const
practitionerPK
=
req
.
body
.
practitionerkey
;
const
practitionerSK
=
req
.
body
.
practitionerseed
;
const
patientKey
=
req
.
body
.
patient
;
const
practitionerRSA
=
req
.
body
.
practitionerrsa
;
//take the current asset code and the issuer key for the patient from the data base
const
assetAndIssuer
=
await
GetIssuerAndAssetCode
(
"
patients
"
,
patientKey
);
...
...
@@ -29,6 +30,7 @@ router.post("/", async (req, res) => {
assetcode
:
assetCode
,
issuerpk
:
issuerPK
,
requesterpk
:
practitionerPK
,
requesterrsa
:
practitionerRSA
,
status
:
"
Pending
"
,
});
try
{
...
...
@@ -58,52 +60,6 @@ router.post("/", async (req, res) => {
error
,
});
});
// await server
// .loadAccount(sourceAccountKeypair.publicKey())
// .then((sourceAccount) => {
// return CreateTrustline(
// assetCode,
// DecryptWithServerKey(assetAndIssuer.issuerKey),
// sourceAccount
// )
// })
// .then(async (result) => {
// if (result) {
// console.log("Trust line created successfully!");
// //add request to DB
// const nftRequestObj = new NFTRequest({
// assetcode: assetCode,
// issuerpk: issuerPK,
// requesterpk: practitionerPK,
// status: "Pending",
// });
// try {
// const saveRequest = await nftRequestObj.save();
// console.log("NFT request saved to database : " + saveRequest);
// res.status(200).json({
// message: "NFT request saved to database",
// });
// console.log("/practitioner/requestnft - requesting NFT success");
// } catch (errorWhenAddingRequestToDB) {
// console.log(
// "Error when adding NFT request to DB : ",
// errorWhenAddingRequestToDB
// );
// console.log("/practitioner/requestnft - requesting NFT failed");
// return res.status(500).json({
// message: "Error when adding NFT request to DB : ",
// errorWhenAddingRequestToDB,
// });
// }
// } else {
// console.log("/practitioner/requestnft - requesting NFT failed");
// return res.status(500).json({
// message: "Failed to request the NFT",
// });
// }
// });
});
module
.
exports
=
router
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment