Yakıt Fişlerinin Mal Sorumlusuna iletilmemesi sorunu giderildi.

This commit is contained in:
2025-11-08 23:12:00 +03:00
parent 6f2b18dce2
commit dca90658da
9 changed files with 111 additions and 19 deletions

View File

@@ -47,7 +47,15 @@
error = '';
try {
const url = `/api/fuel-slips?manager_id=${user.id}&status=approved`;
const params = new URLSearchParams({ status: 'approved' });
if (user.unit_id) {
params.set('unit_id', user.unit_id);
} else if (user.id) {
params.set('manager_id', user.id);
} else {
throw new Error('Kullanıcı bilgilerinde eksik alan var.');
}
const url = `/api/fuel-slips?${params.toString()}`;
const response = await fetch(url);
if (response.ok) {
@@ -599,4 +607,4 @@
max-height: 2000px;
}
}
</style>
</style>