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

Function deleteLayoutItem

frontend/src/stores/useLayoutConfig.ts:18–29  ·  view source on GitHub ↗
(pageName: string, id: string)

Source from the content-addressed store, hash-verified

16 };
17
18 const deleteLayoutItem = (pageName: string, id: string) => {
19 if (!pageName) pageName = currentRoutePath.value;
20 const items = getPageLayoutConfig(pageName);
21 let index = 0;
22 for (const iterator of items) {
23 if (iterator?.id === id) {
24 return items.splice(index, 1)?.[0];
25 }
26 index++;
27 }
28 return null;
29 };
30
31 const insertLayoutItem = (pageName: string, card: LayoutCard, index?: number) => {
32 if (!pageName) pageName = currentRoutePath.value;

Callers 2

deleteCardFunction · 0.85
moveCardItemFunction · 0.85

Calls 1

getPageLayoutConfigFunction · 0.85

Tested by

no test coverage detected