# Components

**CreateBulkItem** - model, endpoint, propDataArray, token
```jsx
<CreateBulkItem 
    model={"List"}
    endpoint="LeumasAPI"
    propDataArray={propDataArray}
    token={auth?.token}
/>

```
**CreateItem** - model, endpoint, propData, token
```jsx
<CreateItem 
    model={"List"}
    endpoint="LeumasAPI"
    propData={propData}
    token={auth?.token}
/>

```
**CustomDropdown** - model, modelArray, endpoint, propData, token, onSelectedChange, color
```jsx
<CustomDropdown 
    model={"List"}
    modelArray={modelArray}
    endpoint="LeumasAPI"
    propData={propData}
    token={auth?.token}
    onSelectedChange={onSelectedChange}
    color={color}
/>

```
**DeleteItem** - model, id, endpoint, token, onToggleChange
```jsx
<DeleteItem 
    model={"List"}
    id={itemId}
    endpoint="LeumasAPI"
    token={auth?.token}
    onToggleChange={onToggleChange}
/>

```
**EditItem** - model, id, endpoint, data, token
```jsx
<EditItem 
    model={"List"}
    id={itemId}
    endpoint="LeumasAPI"
    data={data}
    token={auth?.token}
/>

```
**GetAllByOwner** - model, id, endpoint, token, CardComponent, setMode, handleSchemaSelect
```jsx
<GetAllByOwner 
    model={"List"}
    id={ownerId}
    endpoint="LeumasAPI"
    token={auth?.token}
    CardComponent={CardComponent}
    setMode={setMode}
    handleSchemaSelect={handleSchemaSelect}
/>

```
**GetAllItems** - model, endpoint, token, Cardcomponent, setMode, handleSchemaSelect
```jsx
<GetAllItems 
    model={"List"}
    endpoint="LeumasAPI"
    token={auth?.token}
    CardComponent={CardComponent}
    setMode={setMode}
    handleSchemaSelect={handleSchemaSelect}
/>

```
**GetItemById** - model, id, endpoint, token
```jsx
<GetItemById 
    model={"List"}
    id={itemId}
    endpoint="LeumasAPI"
    token={auth?.token}
/>

```
**ItemRenderer** - model, renderData, setMode, setIcon, token, baseLink
```jsx
<ItemRenderer 
    model={"List"}
    renderData={renderData}
    setMode={setMode}
    setIcon={setIcon}
    token={auth?.token}
    baseLink={baseLink}
/>

```

**SaveButton** - model, data, isLoading, setIsLoading, setMessage, setMessgaeType, onSuccess, editMode, selectedItemId, styles
```jsx
<SaveButton 
    model={"List"}
    data={data}
    isLoading={isLoading}
    setIsLoading={setIsLoading}
    setMessage={setMessage}
    setMessageType={setMessageType}
    onSuccess={onSuccess}
    editMode={editMode}
    selectedItemId={selectedItemId}
    styles={styles}
/>

```

**ToggleStatus** - model, isPublished, endpoint, itemId, token, onToggleChange
```jsx
<ToggleStatus 
    model={"List"}
    isPublished={isPublished}
    endpoint="LeumasAPI"
    itemId={itemId}
    token={auth?.token}
    onToggleChange={onToggleChange}
/>

```










# Helpers

**createItem** - model, endpointKey, data, token
```jsx
const dataToSubmit ={
    model: "list",
    endpoint: "LeumasAPI",
    data: {
        ... data
    }
}
    const response = await createITem("List", "LeumasAPI", dataToSubmit auth?.token)
```












**createItemsBulk** - model, endpointKey, bulkData, token
```jsx
const DataToSubmit = [
    {...Item1},
    {...Item2},
]
    const response = await createItemsBulk("List", "LeumasAPI", DataToSubmit, auth?.token)
```














**editItem** - model, id, data, endpointKey, token
```jsx
const dataToSubmit = {
    ...data
}
const response = await editItem("List", itemId, dataToSubmit, "LeumasAPI", auth?.token)

```







**editCoverPhoto** - blockId, coverPhotoUrl, token, ownerID
```jsx
const dataToSubmit = {
    coverPhotoUrl,
    ownerID
}
const response = await editCoverPhoto(blockId, dataToSubmit, auth?.token)

```


















**getAllItems** - model, endpointKey, token
```jsx
    const response = await getAllItems("List", "LeumasAPI", auth?.token)

```
**getAllOwnerRelated** - owner, endpointKey, token
```jsx
    const response = await getAllOwnerRelated(owner, "LeumasAPI", auth?.token)

```
**getAllOwnerCreated** - owner, endpointKey, token
```jsx
    const response = await getAllOwnerCreated(owner, "LeumasAPI", auth?.token)

```
**getAllPublicItems** - model, endpointKey, token
```jsx
    const response = await getAllPublicItems("List", "LeumasAPI", auth?.token)

```
**getItemById** - model, id, endpointKey, token
```jsx
    const response = await getItemById("List", itemId, "LeumasAPI", auth?.token)

```
**getRelatedApp** - id, endpointKey, token
```jsx
    const response = await getRelatedApp(itemId, "LeumasAPI", auth?.token)

```
**getItemsByOwner** - model, id, endpointKey, token
```jsx
    const response = await getItemsByOwner("List", itemId, "LeumasAPI", auth?.token)

```
**getVirtualIdsByOwner** - id, endpointKey, token
```jsx
    const response = await getVirtualIdsByOwner(itemId, "LeumasAPI", auth?.token)

```
**deleteItem** - model, id, endpointKey, token
```jsx
    const response = await deleteItem("List", itemId, "LeumasAPI", auth?.token)

```
**togglePublishStatus** - model, endpointKey, id, token
```jsx
    const response = await togglePublishStatus("List", "LeumasAPI", itemId, auth?.token)

```
**filterItems** - model, criteria, endpointKey, token
```jsx
    const response = await filterItems("List", criteria, "LeumasAPI", auth?.token)

```
**searchItems** - model, query, endpointKey, token
```jsx
    const response = await searchItems("List", query, "LeumasAPI", auth?.token)

```
**bulkEditItems** - model, items, endpointKey, token
```jsx
    const DataToSubmit = [
    { ...Item1 },
    { ...Item2 },
]
const response = await bulkEditItems("List", DataToSubmit, "LeumasAPI", auth?.token)

```
**exportItems** - model, endpointKey, token
```jsx
    const response = await exportItems("List", "LeumasAPI", auth?.token)

```
**getItemHistoryLog** - model, itemId, endpointKey, token, userId
```jsx
    const dataToSubmit = {
    userId
}
const response = await getItemHistoryLog("List", itemId, "LeumasAPI", dataToSubmit, auth?.token)

```
**undoLastAction** - model, itemId, endpointKey, token
```jsx
    const response = await undoLastAction("List", itemId, "LeumasAPI", auth?.token)

```
**redoLastAction** - model, itemId, endpointKey, token
```jsx
    const response = await redoLastAction("List", itemId, "LeumasAPI", auth?.token)

```
**setUserPermissions** - model, itemId, permissions, endpointKey, token
```jsx
    const dataToSubmit = {
    permissions
}
const response = await setUserPermissions("List", itemId, dataToSubmit, "LeumasAPI", auth?.token)

```
**sendNotifications** - model, notificationData, endpointKey, token
```jsx
    const dataToSubmit = {
    ...notificationData
}
const response = await sendNotifications("List", dataToSubmit, "LeumasAPI", auth?.token)

```
**toggleFavoriteItem** - model, itemId, endpointKey, token
```jsx
    const response = await toggleFavoriteItem("List", itemId, "LeumasAPI", auth?.token)

```
**processBatchTasks** - model, batchTasks, endpointKey, token
```jsx
    const DataToSubmit = [
    { ...Task1 },
    { ...Task2 },
]
const response = await processBatchTasks("List", DataToSubmit, "LeumasAPI", auth?.token)

```
**suggestRelatedItems** - model, itemId, endpointKey, token
```jsx
    const response = await suggestRelatedItems("List", itemId, "LeumasAPI", auth?.token)

```
**getItemFromDynamicSchema** - model, itemId, endpointKey, token
```jsx
    const response = await getItemFromDynamicSchema("List", itemId, "LeumasAPI", auth?.token)

```
**createItemForDynamicSchema** - model, data, endpointKey, token
```jsx
    const dataToSubmit = {
    ...data
}
const response = await createItemForDynamicSchema("List", dataToSubmit, "LeumasAPI", auth?.token)

```
**editItemFromDynamicSchema** - model, itemId, data, endpointKey, token
```jsx
    const dataToSubmit = {
    ...data
}
const response = await editItemFromDynamicSchema("List", itemId, dataToSubmit, "LeumasAPI", auth?.token)

```
**deleteItemFromDynamicSchema** - model, itemId, endpointKey, token
```jsx
    const response = await deleteItemFromDynamicSchema("List", itemId, "LeumasAPI", auth?.token)

```



# Endpoints

```
import { endpoints } from "leumas-universal-crud-react"

console.log(endpoints)
```