MCPcopy Index your code
hub / github.com/PartPilotLab/PartPilot / updatePartInState

Function updatePartInState

app/dashboardPage.tsx:179–190  ·  view source on GitHub ↗
(part: PartState)

Source from the content-addressed store, hash-verified

177 }, []);
178
179 const updatePartInState = (part: PartState) => {
180 setParts((prevParts) => {
181 const index = prevParts.findIndex((p) => p.id === part.id);
182 if (index !== -1) {
183 const updatedPart = { ...part };
184 const newParts = [...prevParts];
185 newParts[index] = updatedPart;
186 return newParts;
187 }
188 return prevParts;
189 });
190 };
191
192 async function searchParts(page: number) {
193 setLoading(true);

Callers 2

getPartInfoFromLCSCFunction · 0.85
updatePartQuantityFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected