[backend/api] Allow naming single emojis during upload (ISH-602)
This commit is contained in:
parent
a8e8b67e0b
commit
553c0cf7ab
1 changed files with 3 additions and 2 deletions
|
@ -68,9 +68,10 @@ public class EmojiController(
|
||||||
[Authorize("role:moderator")]
|
[Authorize("role:moderator")]
|
||||||
[ProducesResults(HttpStatusCode.OK)]
|
[ProducesResults(HttpStatusCode.OK)]
|
||||||
[ProducesErrors(HttpStatusCode.Conflict)]
|
[ProducesErrors(HttpStatusCode.Conflict)]
|
||||||
public async Task<EmojiResponse> UploadEmoji(IFormFile file)
|
public async Task<EmojiResponse> UploadEmoji(IFormFile file, [FromQuery] string name)
|
||||||
{
|
{
|
||||||
var emoji = await emojiSvc.CreateEmojiFromStreamAsync(file.OpenReadStream(), file.FileName, file.ContentType);
|
var ext = Path.HasExtension(file.FileName) ? Path.GetExtension(file.FileName) : "";
|
||||||
|
var emoji = await emojiSvc.CreateEmojiFromStreamAsync(file.OpenReadStream(), name + ext, file.ContentType);
|
||||||
|
|
||||||
return new EmojiResponse
|
return new EmojiResponse
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue