mirror of
https://github.com/bitwarden/browser
synced 2026-02-02 09:43:29 +00:00
* [deps] Autofill: Update prettier to v3 * prettier formatting updates --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
27 lines
687 B
TypeScript
27 lines
687 B
TypeScript
import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.service.abstraction";
|
|
import { SendService } from "@bitwarden/common/tools/send/services/send.service.abstraction";
|
|
|
|
import { Response } from "../../../models/response";
|
|
|
|
export class SendDeleteCommand {
|
|
constructor(
|
|
private sendService: SendService,
|
|
private sendApiService: SendApiService,
|
|
) {}
|
|
|
|
async run(id: string) {
|
|
const send = await this.sendService.getFromState(id);
|
|
|
|
if (send == null) {
|
|
return Response.notFound();
|
|
}
|
|
|
|
try {
|
|
await this.sendApiService.delete(id);
|
|
return Response.success();
|
|
} catch (e) {
|
|
return Response.error(e);
|
|
}
|
|
}
|
|
}
|