Skip to content

Commit

Permalink
replace ' ' with '_'
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-Valkenburg committed Jun 17, 2024
1 parent ec25728 commit cc91d52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Talpa Api/Controllers/Api/CustomizationController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public ActionResult UpdateCustomization(string? name, bool? gradient, string? co
return BadRequest();
}

var path = Path.Combine("wwwroot", "logo", image.FileName);
var path = Path.Combine("wwwroot", "logo", image.FileName.Replace(' ', '_'));

try
{
Expand All @@ -53,7 +53,7 @@ public ActionResult UpdateCustomization(string? name, bool? gradient, string? co
return BadRequest();
}

var customization = new Customization(name ?? "Talpa", gradient!.Value, color1, color2, color3, Path.Combine(HttpContext.Request.Host.Value, "logo", image.FileName));
var customization = new Customization(name ?? "Talpa", gradient!.Value, color1, color2, color3, Path.Combine(HttpContext.Request.Host.Value, "logo", image.FileName.Replace(' ', '_')));

context.Customization.Add(customization);
context.SaveChanges();
Expand Down Expand Up @@ -88,7 +88,7 @@ public ActionResult UpdateCustomization(string? name, bool? gradient, string? co

if (image is not null)
{
currentCustomization.LogoPath = Path.Combine(HttpContext.Request.Host.Value, "logo", image.FileName);
currentCustomization.LogoPath = Path.Combine(HttpContext.Request.Host.Value, "logo", image.FileName.Replace(' ', '_'));
}

context.Customization.Update(currentCustomization);
Expand Down

0 comments on commit cc91d52

Please sign in to comment.