fix filter year dashboard

This commit is contained in:
arifal
2025-02-28 15:43:07 +07:00
parent f3db3783f9
commit f5790cda94
4 changed files with 9 additions and 8 deletions

View File

@@ -19,11 +19,12 @@ class BigDataResumeController extends Controller
try{
$filterDate = $request->get("filterByDate");
// If filterByDate is "latest" or empty, get the most recent record
if (!$filterDate || $filterDate === "latest") {
$big_data_resume = BigdataResume::latest()->first();
$big_data_resume = BigdataResume::where('year', now()->year)->latest()->first();
if (!$big_data_resume) {
return $this->response_empty_resume();
}
} else {
// Filter by specific date
$big_data_resume = BigdataResume::whereDate('created_at', $filterDate)
->orderBy('id', 'desc')
->first();

View File

@@ -118,7 +118,8 @@ class ServiceSIMBG
$importDatasource = ImportDatasource::create([
'status' => ImportDatasourceStatus::Processing->value,
]);
$initResToken = $this->getToken();
if (empty($initResToken->original['data']['token']['access'])) {
$importDatasource->update([
'status' => ImportDatasourceStatus::Failed->value,
@@ -126,8 +127,6 @@ class ServiceSIMBG
]);
return $this->resError("Failed to retrieve token");
}
$initResToken = $this->getToken();
$apiToken = $initResToken->original['data']['token']['access'];
$headers = ['Authorization' => "Bearer " . $apiToken];

View File

@@ -5,6 +5,7 @@ use Illuminate\Http\Request;
define('LARAVEL_START', microtime(true));
ini_set('max_execution_time',14400);
ini_set('memory_limit', '2G');
// Determine if the application is in maintenance mode...
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {

View File

@@ -1,8 +1,8 @@
@extends('layouts.vertical', ['subtitle' => 'Data'])
@extends('layouts.vertical', ['subtitle' => 'PDAM'])
@section('content')
@include('layouts.partials/page-title', ['title' => 'Data', 'subtitle' => 'Tata Ruang'])
@include('layouts.partials/page-title', ['title' => 'Data', 'subtitle' => 'PDAM'])
<x-toast-notification />
<div class="row">