(e)
| 76 | dispatch(deleteProdcut(product._id)); |
| 77 | }; |
| 78 | const uploadFileHandler = (e) => { |
| 79 | const file = e.target.files[0]; |
| 80 | const bodyFormData = new FormData(); |
| 81 | bodyFormData.append('image', file); |
| 82 | setUploading(true); |
| 83 | axios |
| 84 | .post('/api/uploads', bodyFormData, { |
| 85 | headers: { |
| 86 | 'Content-Type': 'multipart/form-data', |
| 87 | }, |
| 88 | }) |
| 89 | .then((response) => { |
| 90 | setImage(response.data); |
| 91 | setUploading(false); |
| 92 | }) |
| 93 | .catch((err) => { |
| 94 | console.log(err); |
| 95 | setUploading(false); |
| 96 | }); |
| 97 | }; |
| 98 | return ( |
| 99 | <div className="content content-margined"> |
| 100 | <div className="product-header"> |
nothing calls this directly
no outgoing calls
no test coverage detected