MCPcopy Create free account
hub / github.com/amigoscode/full-stack-professional / fetchCustomers

Function fetchCustomers

frontend/react/src/Customer.jsx:20–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 const [err, setError] = useState("");
19
20 const fetchCustomers = () => {
21 setLoading(true);
22 getCustomers().then(res => {
23 setCustomers(res.data)
24 }).catch(err => {
25 setError(err.response.data.message)
26 errorNotification(
27 err.code,
28 err.response.data.message
29 )
30 }).finally(() => {
31 setLoading(false)
32 })
33 }
34
35 useEffect(() => {
36 fetchCustomers();

Callers 4

CustomerFunction · 0.85
MyDropzoneFunction · 0.85
UpdateCustomerFormFunction · 0.85
CardWithImageFunction · 0.85

Calls 2

getCustomersFunction · 0.90
errorNotificationFunction · 0.90

Tested by

no test coverage detected