mirror of
https://github.com/bitwarden/server
synced 2025-12-22 03:03:33 +00:00
Revert filescoped (#2227)
* Revert "Add git blame entry (#2226)" This reverts commit239286737d. * Revert "Turn on file scoped namespaces (#2225)" This reverts commit34fb4cca2a.
This commit is contained in:
@@ -6,39 +6,40 @@ using Bit.Core.Utilities;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bit.Api.Controllers;
|
||||
|
||||
[Route("installations")]
|
||||
[SelfHosted(NotSelfHostedOnly = true)]
|
||||
public class InstallationsController : Controller
|
||||
namespace Bit.Api.Controllers
|
||||
{
|
||||
private readonly IInstallationRepository _installationRepository;
|
||||
|
||||
public InstallationsController(
|
||||
IInstallationRepository installationRepository)
|
||||
[Route("installations")]
|
||||
[SelfHosted(NotSelfHostedOnly = true)]
|
||||
public class InstallationsController : Controller
|
||||
{
|
||||
_installationRepository = installationRepository;
|
||||
}
|
||||
private readonly IInstallationRepository _installationRepository;
|
||||
|
||||
[HttpGet("{id}")]
|
||||
[AllowAnonymous]
|
||||
public async Task<InstallationResponseModel> Get(Guid id)
|
||||
{
|
||||
var installation = await _installationRepository.GetByIdAsync(id);
|
||||
if (installation == null)
|
||||
public InstallationsController(
|
||||
IInstallationRepository installationRepository)
|
||||
{
|
||||
throw new NotFoundException();
|
||||
_installationRepository = installationRepository;
|
||||
}
|
||||
|
||||
return new InstallationResponseModel(installation, false);
|
||||
}
|
||||
[HttpGet("{id}")]
|
||||
[AllowAnonymous]
|
||||
public async Task<InstallationResponseModel> Get(Guid id)
|
||||
{
|
||||
var installation = await _installationRepository.GetByIdAsync(id);
|
||||
if (installation == null)
|
||||
{
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
||||
[HttpPost("")]
|
||||
[AllowAnonymous]
|
||||
public async Task<InstallationResponseModel> Post([FromBody] InstallationRequestModel model)
|
||||
{
|
||||
var installation = model.ToInstallation();
|
||||
await _installationRepository.CreateAsync(installation);
|
||||
return new InstallationResponseModel(installation, true);
|
||||
return new InstallationResponseModel(installation, false);
|
||||
}
|
||||
|
||||
[HttpPost("")]
|
||||
[AllowAnonymous]
|
||||
public async Task<InstallationResponseModel> Post([FromBody] InstallationRequestModel model)
|
||||
{
|
||||
var installation = model.ToInstallation();
|
||||
await _installationRepository.CreateAsync(installation);
|
||||
return new InstallationResponseModel(installation, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user