Refactor error handling and enhance API interactions across Filament pages
- Introduced `ApiErrorTranslator` to normalize and translate API error messages, providing clearer feedback in French. - Updated all Filament pages (Articles, Documents, Divers, Journaux, Tiers, TablesExplorer) to utilize the new error translation mechanism, improving user experience during API interactions. - Added validation for required fields before API calls, ensuring users receive immediate feedback when mandatory inputs are missing. - Implemented tracking properties to distinguish between "never searched" and "searched without results," enhancing the user interface. - Removed the obsolete `$results` property from the Articles page and added a new `$barcode` property to align with API requirements. - Updated documentation to reflect changes in API behavior and error handling, including new metadata returned by the `art_list` endpoint. - Added new tests to verify the functionality of the barcode handling and validation logic.
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
</div>
|
||||
|
||||
<div wire:loading.remove wire:target="getSerialNumber" class="mt-4">
|
||||
<x-logistics.json-block :data="$serialData" />
|
||||
<x-logistics.json-block :data="$serialData" :searched="$hasSerial" />
|
||||
</div>
|
||||
</div>
|
||||
</x-logistics.card>
|
||||
@@ -56,7 +56,7 @@
|
||||
</div>
|
||||
|
||||
<div wire:loading.remove wire:target="searchCodes" class="mt-4">
|
||||
<x-logistics.json-block :data="$codesData" />
|
||||
<x-logistics.json-block :data="$codesData" :searched="$hasCodes" />
|
||||
</div>
|
||||
</div>
|
||||
</x-logistics.card>
|
||||
@@ -118,7 +118,7 @@
|
||||
</div>
|
||||
|
||||
<div wire:loading.remove wire:target="updateStock" class="mt-4">
|
||||
<x-logistics.json-block :data="$updateStockResult" />
|
||||
<x-logistics.json-block :data="$updateStockResult" :searched="$hasUpdatedStock" />
|
||||
</div>
|
||||
</div>
|
||||
</x-logistics.card>
|
||||
|
||||
Reference in New Issue
Block a user