From de33798a715184e73afc497bb6330155b9036c51 Mon Sep 17 00:00:00 2001 From: Karthik Vempati Date: Fri, 22 Jul 2022 20:56:07 +0200 Subject: [PATCH] rework random generation --- frontend/src/Api.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/src/Api.js b/frontend/src/Api.js index 76ac30e..e9c31ac 100644 --- a/frontend/src/Api.js +++ b/frontend/src/Api.js @@ -22,5 +22,11 @@ export default { }] }), + getRandom: () => instance.get('/api/v1/recipe/random', { + transformResponse: [function (data) { + return data? JSON.parse(data) : data; + }] + }), + removeForId: (id) => instance.delete('/api/v1/items/'+ id) } \ No newline at end of file