Beging to add the authorization with a JWT token
This commit is contained in:
@@ -7,15 +7,16 @@ namespace skydiveLogs_api.Business.Interface
|
||||
{
|
||||
public interface IJumpService
|
||||
{
|
||||
IEnumerable<Jump> GetAllJumps();
|
||||
IEnumerable<Jump> GetAllJumps(User connectedUser);
|
||||
|
||||
Jump GetJumpById(int id);
|
||||
|
||||
void AddNewJump(int aircraftId,
|
||||
int dzId,
|
||||
int jumpTypeId,
|
||||
int gearId,
|
||||
Jump jump);
|
||||
int gearId,
|
||||
Jump jump,
|
||||
User connectedUser);
|
||||
|
||||
void UpdateJump(int id, Jump jump);
|
||||
|
||||
|
||||
@@ -27,7 +27,8 @@ namespace skydiveLogs_api.Business
|
||||
int dzId,
|
||||
int jumpTypeId,
|
||||
int gearId,
|
||||
Jump jump)
|
||||
Jump jump,
|
||||
User connectedUser)
|
||||
{
|
||||
var selectedGear = _gearService.GetGearById(gearId);
|
||||
var selectedJumpType = _jumpTypeService.GetJumpTypeById(jumpTypeId);
|
||||
@@ -38,6 +39,7 @@ namespace skydiveLogs_api.Business
|
||||
jump.JumpType = selectedJumpType;
|
||||
jump.DropZone = selectedDropZone;
|
||||
jump.Gear = selectedGear;
|
||||
jump.UserId = connectedUser.Id;
|
||||
|
||||
_jumpRepository.Add(jump);
|
||||
}
|
||||
@@ -47,9 +49,9 @@ namespace skydiveLogs_api.Business
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IEnumerable<Jump> GetAllJumps()
|
||||
public IEnumerable<Jump> GetAllJumps(User connectedUser)
|
||||
{
|
||||
return _jumpRepository.GetAll();
|
||||
return _jumpRepository.GetAll(connectedUser.Id);
|
||||
}
|
||||
|
||||
public Jump GetJumpById(int id)
|
||||
|
||||
Reference in New Issue
Block a user