test local paths

This commit is contained in:
Brian Emilius
2020-10-01 17:33:42 +02:00
parent f9b9a4106c
commit de6c6919e6

View File

@@ -37,10 +37,14 @@ async function getSingleAsset(req, res, next) {
async function updateSingleAsset(req, res, next) {
try {
let asset = await Asset.findByPk(req.params.id);
asset.update({
url: req.fields.url
});
if (asset) {
asset.url = req.fields.url;
asset.save();
res.json(asset);
} else {
res.status(404).end();
}
} catch(error) {
console.error(error);
res.status(500).end();