18 lines
647 B
TypeScript
18 lines
647 B
TypeScript
import { ClientDisplayableError, isErrorResponse } from '@standardnotes/responses'
|
|
import { SharedVaultUsersServerInterface } from '@standardnotes/api'
|
|
|
|
export class RemoveVaultMember {
|
|
constructor(private vaultUserServer: SharedVaultUsersServerInterface) {}
|
|
|
|
async execute(params: { sharedVaultUuid: string; userUuid: string }): Promise<ClientDisplayableError | void> {
|
|
const response = await this.vaultUserServer.deleteSharedVaultUser({
|
|
sharedVaultUuid: params.sharedVaultUuid,
|
|
userUuid: params.userUuid,
|
|
})
|
|
|
|
if (isErrorResponse(response)) {
|
|
return ClientDisplayableError.FromNetworkError(response)
|
|
}
|
|
}
|
|
}
|