MCPcopy Create free account
hub / github.com/docker/getting-started / submitNewItem

Function submitNewItem

app/src/static/js/app.js:76–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74 const [submitting, setSubmitting] = React.useState(false);
75
76 const submitNewItem = e => {
77 e.preventDefault();
78 setSubmitting(true);
79 fetch('/items', {
80 method: 'POST',
81 body: JSON.stringify({ name: newItem }),
82 headers: { 'Content-Type': 'application/json' },
83 })
84 .then(r => r.json())
85 .then(item => {
86 onNewItem(item);
87 setSubmitting(false);
88 setNewItem('');
89 });
90 };
91
92 return (
93 <Form onSubmit={submitNewItem}>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…