Ejemplo n.º 1
0
        public async Task <IActionResult> Cleanup([FromRoute] int daysCleanup)
        {
            var user = await _userService.GetCurrent();

            if (!user.IsAdmin)
            {
                return(Forbid());
            }

            if (daysCleanup < 1)
            {
                return(BadRequest());
            }

            await _pdfService.Cleanup(daysCleanup);

            await _adminService.Cleanup(daysCleanup);

            return(NoContent());
        }