github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/build-blockchain-insurance-app-master/web/src/repair-shop/api.js (about)

     1  'use strict';
     2  
     3  import fetch from 'isomorphic-fetch';
     4  
     5  export function getRepairOrders() {
     6    return fetch('/repair-shop/api/repair-orders', {
     7      method: 'POST',
     8      headers: new Headers({
     9        'Content-Type': 'application/json'
    10      })
    11    }).then(async res => {
    12      return await res.json();
    13    });
    14  }
    15  
    16  export function completeRepairOrder(uuid) {
    17    return fetch('/repair-shop/api/complete-repair-order', {
    18      method: 'POST',
    19      headers: new Headers({
    20        'Content-Type': 'application/json'
    21      }),
    22      body: JSON.stringify({ uuid })
    23    }).then(async res => {
    24      return await res.json();
    25    });
    26  }