I am getting this error message and cannot figure out what my problem is.
TypeError: profileService.GetCurrentUserDemographicForEdit is not a function
at init (VM1342 userDemographicsModal.js:34)
at new <anonymous> (VM1342 userDemographicsModal.js:41)
at e (angular.js:4523)
at Object.instantiate (angular.js:4531)
at angular.js:9197
at ui-bootstrap-tpls.min.js:9
at angular.js:14792
at r.$eval (angular.js:16052)
at r.$digest (angular.js:15870)
at r.$apply (angular.js:16160)
Here are snippets of my code.
userDemographicsModal.js
function init() {
profileService.GetCurrentUserDemographicForEdit({
id: appSession.user.id
}).success(function (result) {
vm.user = result;
});
}
IProfileAppService.cs
namespace AHPClaims.AHPClaims.Authorization.Users.Profile
{
public interface IProfileAppService : IApplicationService
{
Task<CurrentUserProfileEditDto> GetCurrentUserProfileForEdit();
Task UpdateCurrentUserProfile(CurrentUserProfileEditDto input);
Task ChangePassword(ChangePasswordInput input);
Task<UserDemographicDto> GetCurrentUserDemographicForEdit();
Task UpdateCurrentUserDemographic(UserDemographicDto input);
}
}
ProfileAppService.cs
public async Task<UserDemographicDto> GetCurrentUserDemographicForEdit()
{
var user = await GetCurrentUserAsync();
return user.MapTo<UserDemographicDto>();
}
UserDemographicDto.cs
namespace AHPClaims.AHPClaims.Authorization.Users.Profile.Dto
{
[AutoMap(typeof(User))]
public class UserDemographicDto
{
public string UserStreetAddress { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Zip { get; set; }
public string Phone { get; set; }
public string UserNPI { get; set; }
}
}
Any help is appreciated. Thanks
2 Answer(s)
-
0
Try profileService.getCurrentUserDemographicForEdit (i.e. lowercase get).
The DI camel cases function calls.
-
0
Thank you. That fixed it.