fix(load): Adding shipment_code
This commit is contained in:
@@ -143,6 +143,12 @@ const postLoad = async(req, res) => {
|
||||
data.name = user_name;
|
||||
const load = new Model( data );
|
||||
await load.save();
|
||||
|
||||
const id = "" + load._id;
|
||||
const shipment_code = "ETA-" + id.substring( 0 , 6 );
|
||||
await Model.findByIdAndUpdate( id , {
|
||||
shipment_code
|
||||
});
|
||||
return res.send( load );
|
||||
}catch(error){
|
||||
console.error( error );
|
||||
|
||||
Reference in New Issue
Block a user