[fix] bug sales

This commit is contained in:
Baghaztra 2025-09-02 10:42:01 +07:00
parent ae5507fda4
commit 3f654c6c7a
2 changed files with 15 additions and 3 deletions

View File

@ -83,9 +83,8 @@ class SalesController extends Controller
public function destroy(int $id)
{
$sales = Sales::findOrFail($id);
$sales->transaksi()->map(function($transaksi) {
$transaksi->update('id_sales', null);
});
$sales->transaksi()->update(['id_sales' => null]);
$sales->delete();
return response()->json([
'message' => 'Sales berhasil dihapus'
], 200);

View File

@ -1,3 +1,4 @@
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');
@import 'tailwindcss';
@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
@ -22,4 +23,16 @@
--color-B: #AFE5FF;
--color-C: #77C7EE;
--color-D: #024768;
}
@keyframes shake {
0%, 100% {
transform: translateX(0);
}
10%, 30%, 50%, 70%, 90% {
transform: translateX(-5px);
}
20%, 40%, 60%, 80% {
transform: translateX(5px);
}
}