Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
fix: coding styles
Browse files Browse the repository at this point in the history
  • Loading branch information
laminne committed Dec 22, 2023
1 parent 7b6c3bb commit c1a4217
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
8 changes: 5 additions & 3 deletions src/entry/service/delete.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import { Entry } from "../entry.js";
describe("DeleteEntryService", () => {
const repository = new DummyRepository();
const service = new DeleteEntryService(repository);
repository.create(Entry.new({
repository.create(
Entry.new({
id: "1",
teamName: "TestTeam",
members: ["TestTaro"],
isMultiWalk: true,
category: "Elementary"
}))
category: "Elementary",
}),
);

it("正しく削除できる", async () => {
const actual = await service.handle("1");
Expand Down
22 changes: 11 additions & 11 deletions src/entry/service/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import { EntryRepository } from "../repository.js";
import { Option } from "@mikuroxina/mini-fn";

export class DeleteEntryService {
private readonly repository: EntryRepository;
private readonly repository: EntryRepository;

constructor (repository: EntryRepository) {
this.repository = repository;
}
constructor(repository: EntryRepository) {
this.repository = repository;
}

async handle(id: string): Promise<Option.Option<Error>> {
const res = await this.repository.delete(id);
if (Option.isSome(res)) {
return Option.some(res[1]);
}
return Option.none();
async handle(id: string): Promise<Option.Option<Error>> {
const res = await this.repository.delete(id);
if (Option.isSome(res)) {
return Option.some(res[1]);
}
}
return Option.none();
}
}

0 comments on commit c1a4217

Please sign in to comment.