MCPcopy Index your code
hub / github.com/codeaashu/claude-code / setField

Function setField

src/components/mcp/ElicitationDialog.tsx:328–344  ·  view source on GitHub ↗
(fieldName_0: string, value: number | string | boolean | string[] | undefined)

Source from the content-addressed store, hash-verified

326 }
327 }
328 function setField(fieldName_0: string, value: number | string | boolean | string[] | undefined) {
329 setFormValues(prev => {
330 const next = {
331 ...prev
332 };
333 if (value === undefined) {
334 delete next[fieldName_0];
335 } else {
336 next[fieldName_0] = value;
337 }
338 return next;
339 });
340 // Clear "required" error when a value is provided
341 if (value !== undefined && validationErrors[fieldName_0] === 'This field is required') {
342 updateValidationError(fieldName_0);
343 }
344 }
345 function updateValidationError(fieldName_1: string, error?: string) {
346 setValidationErrors(prev_0 => {
347 const next_0 = {

Callers 4

unsetFieldFunction · 0.85
commitTextFieldFunction · 0.85
resolveFieldAsyncFunction · 0.85
ElicitationFormDialogFunction · 0.85

Calls 1

updateValidationErrorFunction · 0.85

Tested by

no test coverage detected