style: Pint 포맷팅 적용
This commit is contained in:
@@ -17,17 +17,21 @@ public function index(Request $request): JsonResponse
|
||||
if ($search = $request->input('search')) {
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('customer', 'like', "%{$search}%")
|
||||
->orWhere('project', 'like', "%{$search}%");
|
||||
->orWhere('project', 'like', "%{$search}%");
|
||||
});
|
||||
}
|
||||
if ($status = $request->input('status')) {
|
||||
if ($status !== 'all') $query->where('status', $status);
|
||||
if ($status !== 'all') {
|
||||
$query->where('status', $status);
|
||||
}
|
||||
}
|
||||
if ($type = $request->input('type')) {
|
||||
if ($type !== 'all') $query->where('type', $type);
|
||||
if ($type !== 'all') {
|
||||
$query->where('type', $type);
|
||||
}
|
||||
}
|
||||
|
||||
$records = $query->orderBy('date', 'desc')->get()->map(fn($item) => [
|
||||
$records = $query->orderBy('date', 'desc')->get()->map(fn ($item) => [
|
||||
'id' => $item->id, 'date' => $item->date?->format('Y-m-d'),
|
||||
'customer' => $item->customer, 'project' => $item->project,
|
||||
'type' => $item->type, 'taxType' => $item->tax_type ?? 'taxable',
|
||||
@@ -93,6 +97,7 @@ public function destroy(int $id): JsonResponse
|
||||
{
|
||||
$tenantId = session('selected_tenant_id', 1);
|
||||
SalesRecord::forTenant($tenantId)->findOrFail($id)->delete();
|
||||
|
||||
return response()->json(['success' => true, 'message' => '매출이 삭제되었습니다.']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user