test local paths
This commit is contained in:
@@ -37,10 +37,14 @@ async function getSingleAsset(req, res, next) {
|
|||||||
async function updateSingleAsset(req, res, next) {
|
async function updateSingleAsset(req, res, next) {
|
||||||
try {
|
try {
|
||||||
let asset = await Asset.findByPk(req.params.id);
|
let asset = await Asset.findByPk(req.params.id);
|
||||||
asset.update({
|
|
||||||
url: req.fields.url
|
if (asset) {
|
||||||
});
|
asset.url = req.fields.url;
|
||||||
res.json(asset);
|
asset.save();
|
||||||
|
res.json(asset);
|
||||||
|
} else {
|
||||||
|
res.status(404).end();
|
||||||
|
}
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
res.status(500).end();
|
res.status(500).end();
|
||||||
|
|||||||
Reference in New Issue
Block a user