Skip to content

Instantly share code, notes, and snippets.

@linux08
Created November 4, 2018 23:33
Show Gist options
  • Save linux08/d2cbae04294955e0bebff8930bf609fe to your computer and use it in GitHub Desktop.
Save linux08/d2cbae04294955e0bebff8930bf609fe to your computer and use it in GitHub Desktop.
exports.create = async (req, res) => {
try {
const data = {
label: req.body.label,
ipfsHash: req.data.ipfsHash,
ipfsAddress: `https://gateway.ipfs.io/ipfs/${req.data.ipfsHash}`,
transactionHash: req.data.ipfsHash,
blockHash: req.data.blockHash,
};
const resp = await Image.create(data);
res.send(resp);
} catch (err) {
res.status(500).send(err.message);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment