Add Upsert function to UserModel and UserViewModel
Description
This PR introduces a new feature upsert feature within userModel. Upsert takes an UserDto and inserts if it doesnt exists else it updates. It closes issue #164
Changes
Adds upsertUserProfile to UserModel and implements it in loadUserProfile to UserViewModel.
Files
Added
None
Modified
User : Added asUserDto
UserModel : Added upsertUserProfile
UserModelSupabase : Implemented upsertUserProfile
UserViewModel : Use upsertUserProfile to correctly load profile
UserModelSupabaseTest : Add tests for upsertUserProfile
UserViewModelTest : Update test for the new implementation of upserUserProfile
Removed
None
Dependencies Added
None
Testing
Added tests for upsertUserProfile in failing and successful cases in UserModelSupabaseTest
Modified tests for loadUserProfile in failing and successful cases in UserViewModelTest
Add Upsert function to
UserModel
andUserViewModel
Description
This PR introduces a new feature upsert feature within
userModel
. Upsert takes anUserDto
and inserts if it doesnt exists else it updates. It closes issue #164Changes
Adds
upsertUserProfile
toUserModel
and implements it inloadUserProfile
toUserViewModel
.Files
Added
Modified
User
: AddedasUserDto
UserModel
: AddedupsertUserProfile
UserModelSupabase
: ImplementedupsertUserProfile
UserViewModel
: UseupsertUserProfile
to correctly load profileUserModelSupabaseTest
: Add tests forupsertUserProfile
UserViewModelTest
: Update test for the new implementation ofupserUserProfile
Removed
Dependencies Added
Testing
upsertUserProfile
in failing and successful cases inUserModelSupabaseTest
loadUserProfile
in failing and successful cases inUserViewModelTest