Checkpoint: deleting is working

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
2021-01-07 16:01:25 +01:00
parent c8c8b62263
commit 56120c4724
2 changed files with 39 additions and 1 deletions

View File

@ -23,8 +23,22 @@ public class ExchangeService {
public Exchange save(Exchange exchange){
return this.repo.save(exchange);
}
/**
* @param id Id of exchange in database
* @return Optional Exchange if found
*/
public Optional<Exchange> getById(Long id){
return this.repo.findById(id);
}
/**
* @param entity Exchange entity which we would like to delete
*/
public void deleteExchange(Exchange entity){
this.repo.delete(entity);
}
/**
* @param assignment Assignment to trade for
* @param group Desired group