Skip to content

Commit

Permalink
fix: get body data only when it does have data (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
taniguchiiqqq authored Feb 13, 2024
1 parent fc5c7f9 commit 37b4967
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions backend/main/src/Group/Router/GroupRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,7 @@ export const groupRouter = (app: Hono) => {
const groupId = c.req.param("groupId");
const action = c.req.query("Action");

const [userIdOrError, body] = await Promise.all([
getUserIdService.getUserId(authHeader(c)),
c.req.json(),
]);
const userIdOrError = await getUserIdService.getUserId(authHeader(c));
if (userIdOrError.err) {
return honoBadRequestAdapter(c, userIdOrError.error.message);
}
Expand Down Expand Up @@ -143,7 +140,7 @@ export const groupRouter = (app: Hono) => {
}

// when update the group name.

const body = await c.req.json();
const useCase = new UpdateGroupNameUseCase(groupRepository);
const controller = new UpdateGroupNameController(useCase);
const result = await controller.execute({
Expand Down

0 comments on commit 37b4967

Please # to comment.