(property: Property)
| 10 | } |
| 11 | |
| 12 | export default function ExampleList(property: Property) { |
| 13 | const sExamplezzStore = useExamplezzStore() |
| 14 | const sToastzzStore = useToastzzStore() |
| 15 | |
| 16 | const [itemzz, setItemzz] = useState<LB.ExampleMap[]>([]) |
| 17 | |
| 18 | useEffect(() => { |
| 19 | refresh() |
| 20 | }, [property.requestId, property.responseId]) |
| 21 | |
| 22 | function refresh() { |
| 23 | makeExampleMapCRUD() |
| 24 | .findAll() |
| 25 | .then((response) => |
| 26 | setItemzz( |
| 27 | response.filter( |
| 28 | (item) => item.requestId === property.requestId && item.responseId === property.responseId, |
| 29 | ), |
| 30 | ), |
| 31 | ) |
| 32 | .catch(sToastzzStore.showError) |
| 33 | } |
| 34 | |
| 35 | return ( |
| 36 | <ItemList |
| 37 | fieldName="exampleId" |
| 38 | itemzz={itemzz} |
| 39 | source={sExamplezzStore.itemzz} |
| 40 | create={function (exampleId) { |
| 41 | return makeExampleMapCRUD() |
| 42 | .create({ |
| 43 | exampleId, |
| 44 | requestId: property.requestId, |
| 45 | responseId: property.responseId, |
| 46 | }) |
| 47 | .then(() => refresh()) |
| 48 | }} |
| 49 | delete={function (id) { |
| 50 | return makeExampleMapCRUD() |
| 51 | .delete(id) |
| 52 | .then(() => refresh()) |
| 53 | }} |
| 54 | ></ItemList> |
| 55 | ) |
| 56 | } |
nothing calls this directly
no test coverage detected