Files
Umbraco-CMS/src/Umbraco.Cms.Api.Management/Controllers/TemporaryFile/ConfigurationTemporaryFileController.cs
Nikolaj Geisle a6ccd5a7a9 Implement temporary file configuration endpoint (#15518)
* Implement temporary file configuration endpoint

* Update MaxfileSize to be a string.

* Make max file size a nullable integer

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-01-10 09:20:29 +01:00

27 lines
1.1 KiB
C#

using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.ViewModels.TemporaryFile;
namespace Umbraco.Cms.Api.Management.Controllers.TemporaryFile;
[ApiVersion("1.0")]
public class ConfigurationTemporaryFileController : TemporaryFileControllerBase
{
private readonly ITemporaryFileConfigurationPresentationFactory _temporaryFileConfigurationPresentationFactory;
public ConfigurationTemporaryFileController(
ITemporaryFileConfigurationPresentationFactory temporaryFileConfigurationPresentationFactory) =>
_temporaryFileConfigurationPresentationFactory = temporaryFileConfigurationPresentationFactory;
[HttpGet("configuration")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
public Task<IActionResult> Configuration()
{
TemporaryFileConfigurationResponseModel responseModel = _temporaryFileConfigurationPresentationFactory.Create();
return Task.FromResult<IActionResult>(Ok(responseModel));
}
}