skirda-backend/api/OrderById/index.js

13 lines
384 B
JavaScript
Raw Permalink Normal View History

2022-08-24 12:08:22 +00:00
const customers = require('../data/customers.json');
module.exports = async function (context, req) {
const { id } = context.bindingData;
let customerId = +id;
const foundCustomer = customers.find(customer => customer.id === id);
context.res = {
// status: 200, /* Defaults to 200 */
body: foundCustomer ? foundCustomer: []
};
}