oops revert

This commit is contained in:
Kim 2023-09-08 12:00:19 +02:00
parent eb54250031
commit d9548f6207
4 changed files with 7 additions and 6 deletions

View File

@ -420,12 +420,12 @@ public class Controller : ControllerBase
} }
[HttpDelete(nameof(DeleteInstallation))] [HttpDelete(nameof(DeleteInstallation))]
public ActionResult DeleteInstallation(Int64 installationId, Token authToken) public async Task<ActionResult> DeleteInstallation(Int64 installationId, Token authToken)
{ {
var session = Db.GetSession(authToken); var session = Db.GetSession(authToken);
var installation = Db.GetInstallationById(installationId); var installation = Db.GetInstallationById(installationId);
return session.Delete(installation) return await session.Delete(installation)
? Ok() ? Ok()
: Unauthorized(); : Unauthorized();
} }

View File

@ -135,7 +135,7 @@ public static class SessionMethods
.Apply(Db.Update); .Apply(Db.Update);
} }
public static Boolean Delete(this Session? session, Installation? installation) public static async Task<Boolean> Delete(this Session? session, Installation? installation)
{ {
var user = session?.User; var user = session?.User;
@ -143,7 +143,8 @@ public static class SessionMethods
&& installation is not null && installation is not null
&& user.HasWriteAccess && user.HasWriteAccess
&& user.HasAccessTo(installation) && user.HasAccessTo(installation)
&& Db.Delete(installation); && Db.Delete(installation)
&& await installation.DeleteBucket();
} }
public static Boolean Create(this Session? session, User newUser) public static Boolean Create(this Session? session, User newUser)

View File

@ -14,8 +14,8 @@ public class S3Cmd
private const String? S3CmdPath = "Resources/s3cmd.py"; private const String? S3CmdPath = "Resources/s3cmd.py";
private const String S3Prefix = "s3://"; private const String S3Prefix = "s3://";
public String Key { get; init; } = S3Access.ReadWrite.Key; public String Key { get; init; }
public String Secret { get; init; } = S3Access.ReadWrite.Secret; public String Secret { get; init; }
public String Region { get; init; } = "sos-ch-dk-2.exo.io"; public String Region { get; init; } = "sos-ch-dk-2.exo.io";
// private String?[] DefaultArgs { get; } // private String?[] DefaultArgs { get; }

Binary file not shown.