mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-04-24 21:54:56 +00:00
Add null checks to transform functions
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -31,9 +31,9 @@ export const updateNewTodo = (data: any, event: any) => event?.target?.value ||
|
||||
|
||||
export const checkCanAddTodo = (data: any) => data.newTodo?.trim().length > 0
|
||||
|
||||
export const transformFilteredUsers = (users: any[]) => `${users.length} users`
|
||||
export const transformFilteredUsers = (users: any[]) => `${users?.length || 0} users`
|
||||
|
||||
export const transformUserList = (users: any[]) => users.map((user: any) => ({
|
||||
export const transformUserList = (users: any[]) => (users || []).map((user: any) => ({
|
||||
type: 'Card',
|
||||
id: `user-${user.id}`,
|
||||
props: {
|
||||
|
||||
Reference in New Issue
Block a user