[backend/api] Fix emoji delete endpoint having emoji twice in the route

This commit is contained in:
Laura Hausmann 2024-07-03 18:35:00 +02:00
parent fdf879d63b
commit e30dbc5753
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -105,16 +105,16 @@ public class EmojiController(
return Ok(await emojiSvc.CloneEmoji(emojo));
}
[HttpPost("import")]
[Authorize("role:admin")]
[ProducesResponseType(StatusCodes.Status202Accepted)]
public async Task<IActionResult> ImportEmoji(IFormFile file, [FromServices] EmojiImportService emojiImportSvc)
{
var zip = await emojiImportSvc.Parse(file.OpenReadStream());
await emojiImportSvc.Import(zip); // TODO: run in background. this will take a while
[HttpPost("import")]
[Authorize("role:admin")]
[ProducesResponseType(StatusCodes.Status202Accepted)]
public async Task<IActionResult> ImportEmoji(IFormFile file, [FromServices] EmojiImportService emojiImportSvc)
{
var zip = await emojiImportSvc.Parse(file.OpenReadStream());
await emojiImportSvc.Import(zip); // TODO: run in background. this will take a while
return Accepted();
}
return Accepted();
}
[HttpPatch("{id}")]
[Authorize("role:admin")]
@ -143,7 +143,7 @@ public class EmojiController(
return Ok(res);
}
[HttpDelete("emoji/{id}")]
[HttpDelete("{id}")]
[Authorize("role:admin")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound, Type = typeof(ErrorResponse))]