MCPcopy Create free account
hub / github.com/SAP-samples/cloud-cap-samples-java / submitOrder

Function submitOrder

app/vue/app.js:74–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72 },
73
74 async submitOrder() {
75 const { book, order } = bookshop,
76 quantity = parseInt(bookshop.order.quantity) || 1; // REVISIT: Okra should be less strict
77 try {
78 const res = await POST(`/submitOrder`, { quantity, book: book.ID });
79 book.stock = res.data.stock;
80 bookshop.order = {
81 quantity,
82 succeeded: `Successfully ordered ${quantity} item(s).`,
83 };
84 } catch (e) {
85 bookshop.order = { quantity, failed: e.response.data.error.message };
86 }
87 },
88
89 async inspectReview(eve) {
90 bookshop.review = bookshop.reviews[eve.currentTarget.rowIndex - 1];

Callers

nothing calls this directly

Calls 1

POSTFunction · 0.85

Tested by

no test coverage detected