leumas-universal-crud-react
v1.0.19
Published
Leumas Universal CRUD to a dynamic Endpoint, Setup your own Dynamic Endpoint and Use Leumas API to send to your MONGO clusters
Downloads
12
Readme
Components
CreateBulkItem - model, endpoint, propDataArray, token
<CreateBulkItem
model={"List"}
endpoint="LeumasAPI"
propDataArray={propDataArray}
token={auth?.token}
/>
CreateItem - model, endpoint, propData, token
<CreateItem
model={"List"}
endpoint="LeumasAPI"
propData={propData}
token={auth?.token}
/>
CustomDropdown - model, modelArray, endpoint, propData, token, onSelectedChange, color
<CustomDropdown
model={"List"}
modelArray={modelArray}
endpoint="LeumasAPI"
propData={propData}
token={auth?.token}
onSelectedChange={onSelectedChange}
color={color}
/>
DeleteItem - model, id, endpoint, token, onToggleChange
<DeleteItem
model={"List"}
id={itemId}
endpoint="LeumasAPI"
token={auth?.token}
onToggleChange={onToggleChange}
/>
EditItem - model, id, endpoint, data, token
<EditItem
model={"List"}
id={itemId}
endpoint="LeumasAPI"
data={data}
token={auth?.token}
/>
GetAllByOwner - model, id, endpoint, token, CardComponent, setMode, handleSchemaSelect
<GetAllByOwner
model={"List"}
id={ownerId}
endpoint="LeumasAPI"
token={auth?.token}
CardComponent={CardComponent}
setMode={setMode}
handleSchemaSelect={handleSchemaSelect}
/>
GetAllItems - model, endpoint, token, Cardcomponent, setMode, handleSchemaSelect
<GetAllItems
model={"List"}
endpoint="LeumasAPI"
token={auth?.token}
CardComponent={CardComponent}
setMode={setMode}
handleSchemaSelect={handleSchemaSelect}
/>
GetItemById - model, id, endpoint, token
<GetItemById
model={"List"}
id={itemId}
endpoint="LeumasAPI"
token={auth?.token}
/>
ItemRenderer - model, renderData, setMode, setIcon, token, baseLink
<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
<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
<ToggleStatus
model={"List"}
isPublished={isPublished}
endpoint="LeumasAPI"
itemId={itemId}
token={auth?.token}
onToggleChange={onToggleChange}
/>
Helpers
createItem - model, endpointKey, data, token
const dataToSubmit ={
model: "list",
endpoint: "LeumasAPI",
data: {
... data
}
}
const response = await createITem("List", "LeumasAPI", dataToSubmit auth?.token)
createItemsBulk - model, endpointKey, bulkData, token
const DataToSubmit = [
{...Item1},
{...Item2},
]
const response = await createItemsBulk("List", "LeumasAPI", DataToSubmit, auth?.token)
editItem - model, id, data, endpointKey, token
const dataToSubmit = {
...data
}
const response = await editItem("List", itemId, dataToSubmit, "LeumasAPI", auth?.token)
editCoverPhoto - blockId, coverPhotoUrl, token, ownerID
const dataToSubmit = {
coverPhotoUrl,
ownerID
}
const response = await editCoverPhoto(blockId, dataToSubmit, auth?.token)
getAllItems - model, endpointKey, token
const response = await getAllItems("List", "LeumasAPI", auth?.token)
getAllOwnerRelated - owner, endpointKey, token
const response = await getAllOwnerRelated(owner, "LeumasAPI", auth?.token)
getAllOwnerCreated - owner, endpointKey, token
const response = await getAllOwnerCreated(owner, "LeumasAPI", auth?.token)
getAllPublicItems - model, endpointKey, token
const response = await getAllPublicItems("List", "LeumasAPI", auth?.token)
getItemById - model, id, endpointKey, token
const response = await getItemById("List", itemId, "LeumasAPI", auth?.token)
getRelatedApp - id, endpointKey, token
const response = await getRelatedApp(itemId, "LeumasAPI", auth?.token)
getItemsByOwner - model, id, endpointKey, token
const response = await getItemsByOwner("List", itemId, "LeumasAPI", auth?.token)
getVirtualIdsByOwner - id, endpointKey, token
const response = await getVirtualIdsByOwner(itemId, "LeumasAPI", auth?.token)
deleteItem - model, id, endpointKey, token
const response = await deleteItem("List", itemId, "LeumasAPI", auth?.token)
togglePublishStatus - model, endpointKey, id, token
const response = await togglePublishStatus("List", "LeumasAPI", itemId, auth?.token)
filterItems - model, criteria, endpointKey, token
const response = await filterItems("List", criteria, "LeumasAPI", auth?.token)
searchItems - model, query, endpointKey, token
const response = await searchItems("List", query, "LeumasAPI", auth?.token)
bulkEditItems - model, items, endpointKey, token
const DataToSubmit = [
{ ...Item1 },
{ ...Item2 },
]
const response = await bulkEditItems("List", DataToSubmit, "LeumasAPI", auth?.token)
exportItems - model, endpointKey, token
const response = await exportItems("List", "LeumasAPI", auth?.token)
getItemHistoryLog - model, itemId, endpointKey, token, userId
const dataToSubmit = {
userId
}
const response = await getItemHistoryLog("List", itemId, "LeumasAPI", dataToSubmit, auth?.token)
undoLastAction - model, itemId, endpointKey, token
const response = await undoLastAction("List", itemId, "LeumasAPI", auth?.token)
redoLastAction - model, itemId, endpointKey, token
const response = await redoLastAction("List", itemId, "LeumasAPI", auth?.token)
setUserPermissions - model, itemId, permissions, endpointKey, token
const dataToSubmit = {
permissions
}
const response = await setUserPermissions("List", itemId, dataToSubmit, "LeumasAPI", auth?.token)
sendNotifications - model, notificationData, endpointKey, token
const dataToSubmit = {
...notificationData
}
const response = await sendNotifications("List", dataToSubmit, "LeumasAPI", auth?.token)
toggleFavoriteItem - model, itemId, endpointKey, token
const response = await toggleFavoriteItem("List", itemId, "LeumasAPI", auth?.token)
processBatchTasks - model, batchTasks, endpointKey, token
const DataToSubmit = [
{ ...Task1 },
{ ...Task2 },
]
const response = await processBatchTasks("List", DataToSubmit, "LeumasAPI", auth?.token)
suggestRelatedItems - model, itemId, endpointKey, token
const response = await suggestRelatedItems("List", itemId, "LeumasAPI", auth?.token)
getItemFromDynamicSchema - model, itemId, endpointKey, token
const response = await getItemFromDynamicSchema("List", itemId, "LeumasAPI", auth?.token)
createItemForDynamicSchema - model, data, endpointKey, token
const dataToSubmit = {
...data
}
const response = await createItemForDynamicSchema("List", dataToSubmit, "LeumasAPI", auth?.token)
editItemFromDynamicSchema - model, itemId, data, endpointKey, token
const dataToSubmit = {
...data
}
const response = await editItemFromDynamicSchema("List", itemId, dataToSubmit, "LeumasAPI", auth?.token)
deleteItemFromDynamicSchema - model, itemId, endpointKey, token
const response = await deleteItemFromDynamicSchema("List", itemId, "LeumasAPI", auth?.token)
Endpoints
import { endpoints } from "leumas-universal-crud-react"
console.log(endpoints)