fix: ApiResponse::handle() 호출 패턴 수정 (callable 사용)
This commit is contained in:
@@ -42,16 +42,13 @@ public function summary(Request $request)
|
||||
$type = $validated['type'] ?? null;
|
||||
$departmentFilter = $validated['department_filter'] ?? 'all';
|
||||
|
||||
$data = $this->calendarService->getSchedules(
|
||||
$startDate,
|
||||
$endDate,
|
||||
$type,
|
||||
$departmentFilter
|
||||
);
|
||||
|
||||
return ApiResponse::handle(
|
||||
data: $data,
|
||||
message: __('message.fetched')
|
||||
);
|
||||
return ApiResponse::handle(function () use ($startDate, $endDate, $type, $departmentFilter) {
|
||||
return $this->calendarService->getSchedules(
|
||||
$startDate,
|
||||
$endDate,
|
||||
$type,
|
||||
$departmentFilter
|
||||
);
|
||||
}, __('message.fetched'));
|
||||
}
|
||||
}
|
||||
@@ -32,8 +32,8 @@ public function summary(Request $request): JsonResponse
|
||||
$year = $request->query('year') ? (int) $request->query('year') : null;
|
||||
$quarter = $request->query('quarter') ? (int) $request->query('quarter') : null;
|
||||
|
||||
$data = $this->entertainmentService->getSummary($limitType, $companyType, $year, $quarter);
|
||||
|
||||
return ApiResponse::handle($data, __('message.fetched'));
|
||||
return ApiResponse::handle(function () use ($limitType, $companyType, $year, $quarter) {
|
||||
return $this->entertainmentService->getSummary($limitType, $companyType, $year, $quarter);
|
||||
}, __('message.fetched'));
|
||||
}
|
||||
}
|
||||
@@ -20,11 +20,8 @@ public function __construct(
|
||||
*/
|
||||
public function summary()
|
||||
{
|
||||
$data = $this->statusBoardService->summary();
|
||||
|
||||
return ApiResponse::handle(
|
||||
data: $data,
|
||||
message: __('message.fetched')
|
||||
);
|
||||
return ApiResponse::handle(function () {
|
||||
return $this->statusBoardService->summary();
|
||||
}, __('message.fetched'));
|
||||
}
|
||||
}
|
||||
@@ -19,9 +19,10 @@ public function __construct(
|
||||
*/
|
||||
public function summary(Request $request): JsonResponse
|
||||
{
|
||||
$limit = $request->input('limit', 30);
|
||||
$data = $this->todayIssueService->summary((int) $limit);
|
||||
$limit = (int) $request->input('limit', 30);
|
||||
|
||||
return ApiResponse::handle(['data' => $data], __('message.fetched'));
|
||||
return ApiResponse::handle(function () use ($limit) {
|
||||
return $this->todayIssueService->summary($limit);
|
||||
}, __('message.fetched'));
|
||||
}
|
||||
}
|
||||
@@ -31,8 +31,8 @@ public function summary(Request $request): JsonResponse
|
||||
$year = $request->query('year') ? (int) $request->query('year') : null;
|
||||
$period = $request->query('period') ? (int) $request->query('period') : null;
|
||||
|
||||
$data = $this->vatService->getSummary($periodType, $year, $period);
|
||||
|
||||
return ApiResponse::handle($data, __('message.fetched'));
|
||||
return ApiResponse::handle(function () use ($periodType, $year, $period) {
|
||||
return $this->vatService->getSummary($periodType, $year, $period);
|
||||
}, __('message.fetched'));
|
||||
}
|
||||
}
|
||||
@@ -38,15 +38,15 @@ public function summary(Request $request): JsonResponse
|
||||
$year = $request->query('year') ? (int) $request->query('year') : null;
|
||||
$quarter = $request->query('quarter') ? (int) $request->query('quarter') : null;
|
||||
|
||||
$data = $this->welfareService->getSummary(
|
||||
$limitType,
|
||||
$calculationType,
|
||||
$fixedAmountPerMonth,
|
||||
$ratio,
|
||||
$year,
|
||||
$quarter
|
||||
);
|
||||
|
||||
return ApiResponse::handle($data, __('message.fetched'));
|
||||
return ApiResponse::handle(function () use ($limitType, $calculationType, $fixedAmountPerMonth, $ratio, $year, $quarter) {
|
||||
return $this->welfareService->getSummary(
|
||||
$limitType,
|
||||
$calculationType,
|
||||
$fixedAmountPerMonth,
|
||||
$ratio,
|
||||
$year,
|
||||
$quarter
|
||||
);
|
||||
}, __('message.fetched'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user