fix: Allow any company modify the load (v1 has no role validation yet)
This commit is contained in:
@@ -108,9 +108,6 @@ const patchLoad = async(req, res) => {
|
|||||||
if( !data ){
|
if( !data ){
|
||||||
throw "load data not sent";
|
throw "load data not sent";
|
||||||
}
|
}
|
||||||
if(permissions !== "role_shipper" ){
|
|
||||||
throw "You can't modify loads";
|
|
||||||
}
|
|
||||||
await Model.findByIdAndUpdate( elementId , data );
|
await Model.findByIdAndUpdate( elementId , data );
|
||||||
return res.send( await Model.findById( elementId ) );
|
return res.send( await Model.findById( elementId ) );
|
||||||
}catch(error){
|
}catch(error){
|
||||||
|
|||||||
Reference in New Issue
Block a user