|
@@ -38,6 +38,10 @@ export class HomeServerSharedVaultInvitesController extends BaseHttpController {
|
|
|
'sync.shared-vault-invites.delete-inbound',
|
|
|
this.deleteInboundUserInvites.bind(this),
|
|
|
)
|
|
|
+ this.controllerContainer.register(
|
|
|
+ 'sync.shared-vault-invites.delete-outbound',
|
|
|
+ this.deleteOutboundUserInvites.bind(this),
|
|
|
+ )
|
|
|
this.controllerContainer.register(
|
|
|
'sync.shared-vault-invites.get-outbound',
|
|
|
this.getOutboundUserInvites.bind(this),
|
|
@@ -172,6 +176,27 @@ export class HomeServerSharedVaultInvitesController extends BaseHttpController {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ async deleteOutboundUserInvites(_request: Request, response: Response): Promise<results.JsonResult> {
|
|
|
+ const result = await this.deleteSharedVaultInvitesSentByUserUseCase.execute({
|
|
|
+ userUuid: response.locals.user.uuid,
|
|
|
+ })
|
|
|
+
|
|
|
+ if (result.isFailed()) {
|
|
|
+ return this.json(
|
|
|
+ {
|
|
|
+ error: {
|
|
|
+ message: result.getError(),
|
|
|
+ },
|
|
|
+ },
|
|
|
+ HttpStatusCode.BadRequest,
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ return this.json({
|
|
|
+ success: true,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
async getOutboundUserInvites(_request: Request, response: Response): Promise<results.JsonResult> {
|
|
|
const result = await this.getSharedVaultInvitesSentByUserUseCase.execute({
|
|
|
senderUuid: response.locals.user.uuid,
|