MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / moveCardItem

Function moveCardItem

frontend/src/stores/useLayoutConfig.ts:43–49  ·  view source on GitHub ↗
(pageName: string, sourceId: string, targetId: string)

Source from the content-addressed store, hash-verified

41 };
42
43 const moveCardItem = (pageName: string, sourceId: string, targetId: string) => {
44 if (!pageName) pageName = currentRoutePath.value;
45 const items = getPageLayoutConfig(pageName);
46 const sourceIndex = getIndexById(pageName, sourceId);
47 const targetIndex = getIndexById(pageName, targetId);
48 items.splice(targetIndex, 0, items.splice(sourceIndex, 1)[0]);
49 };
50
51 const getIndexById = (pageName: string, id: string) => {
52 if (!pageName) pageName = currentRoutePath.value;

Callers

nothing calls this directly

Calls 2

getPageLayoutConfigFunction · 0.85
getIndexByIdFunction · 0.85

Tested by

no test coverage detected