diff --git a/RaceLapTimer/IrDaemonNotifier/IrDaemonNotifier.csproj b/RaceLapTimer/IrDaemonNotifier/IrDaemonNotifier.csproj
index e8b9ad1..1a56da8 100644
--- a/RaceLapTimer/IrDaemonNotifier/IrDaemonNotifier.csproj
+++ b/RaceLapTimer/IrDaemonNotifier/IrDaemonNotifier.csproj
@@ -40,7 +40,7 @@
-
+
diff --git a/RaceLapTimer/IrDaemonNotifier/IdDaemonTransponderUtilityFactory.cs b/RaceLapTimer/IrDaemonNotifier/IrDaemonTransponderUtilityFactory.cs
similarity index 100%
rename from RaceLapTimer/IrDaemonNotifier/IdDaemonTransponderUtilityFactory.cs
rename to RaceLapTimer/IrDaemonNotifier/IrDaemonTransponderUtilityFactory.cs
diff --git a/RaceLapTimer/RaceLapTimer/ApiControllers/PilotApiModule.cs b/RaceLapTimer/RaceLapTimer/ApiControllers/PilotApiModule.cs
index 28f2001..79da9d9 100644
--- a/RaceLapTimer/RaceLapTimer/ApiControllers/PilotApiModule.cs
+++ b/RaceLapTimer/RaceLapTimer/ApiControllers/PilotApiModule.cs
@@ -23,13 +23,21 @@ namespace RaceLapTimer.ApiControllers
Post["/create"] = args => EditCreatePilot();
Get["/delete/{id}"] = args => DeletePilot(args);
Post["/upload/{id}"] = args => UploadPicture(args);
+ Delete["/transponder/{id}"] = args => RemoveTransponderToken(args);
+ }
+
+ private dynamic RemoveTransponderToken(dynamic args)
+ {
+ var pilotId = args.Id;
+ //_provider.
+ return Context.GetRedirect("/pilots");
}
private dynamic UploadPicture(dynamic args)
{
var pilotId = args.Id;
var pilot = (Pilot)_provider.GetPilot(pilotId);
- var oldImagePath = pilot.ImageUrl;
+ var oldImageName = Path.GetFileName(pilot.ImageUrl);
var uploadDirectory = Path.Combine(_rootPathProvider.GetRootPath(), "images");
@@ -57,7 +65,7 @@ namespace RaceLapTimer.ApiControllers
pilot.ImageUrl = "/images/" + generatedFileName;
_provider.UpdatePilot(pilot);
- File.Delete(Path.Combine(uploadDirectory, oldImagePath));
+ File.Delete(Path.Combine(uploadDirectory, oldImageName));
}
string returnurl = "/pilot/edit/" + pilotId;