Class: UserDataAccess

UserDataAccess()

Class to handle user data access operations using localStorage.

Constructor

new UserDataAccess()

Constructor initializes the localStorage with dummy data if not already set.
Source:

Methods

deleteUser(id)

Delete a user from localStorage by their ID.
Parameters:
Name Type Description
id number The ID of the user to delete.
Source:

getAllUsers() → {Array.<Object>}

Get all users from localStorage.
Source:
Returns:
Array of user objects.
Type
Array.<Object>

getUserById(id) → {Object}

Get a user by their ID.
Parameters:
Name Type Description
id number The ID of the user to retrieve.
Source:
Returns:
User object with the specified ID.
Type
Object

insertUser(newUser)

Insert a new user into localStorage.
Parameters:
Name Type Description
newUser Object The new user object to insert.
Source:

updateUser(updatedUser)

Update an existing user in localStorage.
Parameters:
Name Type Description
updatedUser Object The updated user object.
Source: