public async Task <ActionResult> Get(int id) { await AuthenticateAdmin(); ProfileDataDto data = await Get <GetProfileDataQuery>().Execute(id); return(Json(data)); }
public async Task <ActionResult> GetPersonalData() { User user = await AuthenticateUser(); ProfileDataDto result = await Get <GetProfileDataQuery>().Execute(user.Id); return(Json(result)); }
public async Task <ActionResult> DeletePersonalDocument(int userId, int fileid) { await AuthenticateAdmin(); OperationResult cmdResult = await Get <DeleteFileCommand>().Execute((userId, fileid)); if (!cmdResult.Success) { return(BadRequest()); } ProfileDataDto result = await Get <GetProfileDataQuery>().Execute(userId); return(Json(result)); }
public async Task <ActionResult> Update([FromBody] ProfileDataDto data) { await AuthenticateAdmin(); OperationResult cmdResult = await Get <UpdateCandidateCommand>().Execute(data); if (!cmdResult.Success) { return(BadRequest()); } ProfileDataDto qResult = await Get <GetProfileDataQuery>().Execute(data.UserId); return(Json(qResult)); }
public async Task <ActionResult> UpdatePersonalData([FromBody] ProfileDataDto personalData) { User user = await AuthenticateUser(); OperationResult cmdResult = await Get <AddOrUpdateProfileDataCommand>().Execute( new AddOrUpdateProfileDataCommandRequest() { UserId = user.Id, Data = personalData }); if (cmdResult.Success) { ProfileDataDto result = await Get <GetProfileDataQuery>().Execute(user.Id); return(Json(result)); } else { return(BadRequest()); } }