diff options
| author | A Farzat <a@farzat.xyz> | 2025-10-12 08:04:10 +0300 |
|---|---|---|
| committer | A Farzat <a@farzat.xyz> | 2025-10-12 08:04:10 +0300 |
| commit | e65ca281f59b47937f9cf5f1560d1f520efcac20 (patch) | |
| tree | cb1e5cc18f2056d025f334344e77314cf219d354 | |
| parent | 298bd8558844962d4122a9af6ce9a51ae69f7d01 (diff) | |
| download | csca5028-e65ca281f59b47937f9cf5f1560d1f520efcac20.tar.gz csca5028-e65ca281f59b47937f9cf5f1560d1f520efcac20.zip | |
Update the front-end to use PATCH calls
| -rw-r--r-- | front-end/src/App.jsx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/front-end/src/App.jsx b/front-end/src/App.jsx index 1bdcdaf..6264e47 100644 --- a/front-end/src/App.jsx +++ b/front-end/src/App.jsx @@ -62,10 +62,9 @@ function App() { const setViewed = async (subscriptionId, viewedTime) => { try { const formData = new FormData(); - formData.append('_id', subscriptionId); formData.append('viewed_time', viewedTime); - await axios.post(`${API_BASE_URL}/set-viewed/`, formData, { + await axios.patch(`${API_BASE_URL}/set-viewed/${subscriptionId}`, formData, { headers: { 'Content-Type': 'multipart/form-data', }, @@ -80,10 +79,9 @@ function App() { try { setUpdatingSubscription(true); const formData = new FormData(); - formData.append('_id', subscriptionId); formData.append('time_between_fetches', newTime.toString()); - await axios.post(`${API_BASE_URL}/set-time-between-fetches/`, formData, { + await axios.patch(`${API_BASE_URL}/set-time-between-fetches/${subscriptionId}`, formData, { headers: { 'Content-Type': 'multipart/form-data', }, |
