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

Function submitReview

app/vue/app.js:98–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96 },
97
98 async submitReview() {
99 const review = bookshop.review;
100 review.rating = parseInt(review.rating); // REVISIT: Okra should be less strict
101 const payload = {
102 rating: review.rating,
103 title: review.title,
104 text: review.text,
105 };
106 try {
107 await POST(
108 `/Books(ID=${bookshop.book.ID})/CatalogService.addReview`,
109 payload
110 );
111 bookshop.message = {
112 succeeded: "Your review was submitted successfully. Thanks.",
113 };
114 } catch (e) {
115 bookshop.message = { failed: e.response.data.error.message };
116 }
117 },
118 },
119});
120

Callers

nothing calls this directly

Calls 1

POSTFunction · 0.85

Tested by

no test coverage detected