Skip to content

Commit

Permalink
eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Inlet-back committed Oct 26, 2024
1 parent 2a4eec7 commit 6622500
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions task_yell/src/lib/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ const COLLECTION_NAME = "events";
*/
export async function createEvent(
userId: string,
event: Event
event: Event,
): Promise<Event[] | null> {
// event.start ~ event.end とコンフリクトする予定があるかどうかを確認する
const events = await readEvents(userId);
const isConflict = events.some(
(e) => event.start <= e.end && event.end >= e.start
(e) => event.start <= e.end && event.end >= e.start,
);
if (isConflict) {
return events;
Expand All @@ -37,15 +37,15 @@ export async function readEvents(userId: string): Promise<Event[]> {

export async function readSingleEvent(
userId: string,
id: string
id: string,
): Promise<Event | null> {
return readSingleData<Event>(`users/${userId}/${COLLECTION_NAME}`, id);
}

export async function updateEvent(
userId: string,
id: string,
eventData: Partial<Event>
eventData: Partial<Event>,
): Promise<void> {
return updateData<Event>(`users/${userId}/${COLLECTION_NAME}`, id, eventData);
}
Expand Down
8 changes: 4 additions & 4 deletions task_yell/test/event.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe("Event CRUD operations", () => {
expect(result).toBeNull();
expect(createData).toHaveBeenCalledWith(
`users/${mockUserId}/events`,
mockEvent
mockEvent,
);
});

Expand All @@ -76,7 +76,7 @@ describe("Event CRUD operations", () => {
expect(event).toEqual(mockEvent);
expect(readSingleData).toHaveBeenCalledWith(
`users/${mockUserId}/events`,
"mockEventId"
"mockEventId",
);
});

Expand All @@ -89,7 +89,7 @@ describe("Event CRUD operations", () => {
"mockEventId",
{
title: "Updated Event",
}
},
);
});

Expand All @@ -99,7 +99,7 @@ describe("Event CRUD operations", () => {
await deleteEvent(mockUserId, "mockEventId");
expect(deleteData).toHaveBeenCalledWith(
`users/${mockUserId}/events`,
"mockEventId"
"mockEventId",
);
});
});

0 comments on commit 6622500

Please sign in to comment.