Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. const getOrders = async (orderId) => {
  2. const orderEntity = await orderRepository.findById(orderId);
  3. if (!orderEntity) {
  4. throw 'USER_DOES_NOT_EXISTS'; // No instance, no status code, just raw string
  5. }
  6. const orderModel = new OrderModel(
  7. orderEntity.id,
  8. orderEntity.name,
  9. orderEntity.description,
  10. orderEntity.transportationDate,
  11. );
  12. return orderModel;
  13. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement