From 249dd82d9717d131e32e280da008fef57641f05d Mon Sep 17 00:00:00 2001 From: "Begerad, Stefan" Date: Wed, 12 Apr 2023 15:33:49 +0200 Subject: [PATCH] feat(react-crud): refactor --- react-crud/app/components/update.jsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/react-crud/app/components/update.jsx b/react-crud/app/components/update.jsx index 937c883..b17752c 100644 --- a/react-crud/app/components/update.jsx +++ b/react-crud/app/components/update.jsx @@ -1,16 +1,17 @@ import React, { useState } from 'react' import axios from 'axios'; + export default function Update() { const [name, setName] = useState(''); const [id, setId] = useState(''); const postData = (e) => { e.preventDefault(); - console.log('id: '+id); - console.log('name: '+name); + console.log('postData() id: '+id); + console.log('postData() name: '+name); const url='http://83.223.94.182:65535/entities/'+id+'/update'; - console.log('url: '+url); + console.log('postData() url: '+url); let data = new FormData(); - data.append('name',name); + data.append('postData() name',name); let config = { method: 'post', maxBodyLength: Infinity, @@ -29,7 +30,7 @@ export default function Update() {