Skip to content

Commit 685c5ed

Browse files
committed
Refactor ProcurementProductCrud.php to use new action method
1 parent a91defc commit 685c5ed

File tree

1 file changed

+7
-24
lines changed

1 file changed

+7
-24
lines changed

app/Crud/ProcurementProductCrud.php

+7-24
Original file line numberDiff line numberDiff line change
@@ -359,23 +359,12 @@ public function setActions( CrudEntry $entry, $namespace )
359359
$entry->$label = (string) ns()->currency->define( $entry->$label );
360360
}
361361

362-
// you can make changes here
363-
$entry->addAction( 'edit', [
364-
'label' => __( 'Edit' ),
365-
'namespace' => 'edit',
366-
'type' => 'GOTO',
367-
'url' => ns()->url( '/dashboard/' . $this->slug . '/edit/' . $entry->id ),
368-
] );
369-
370-
$entry->addAction( 'delete', [
371-
'label' => __( 'Delete' ),
372-
'namespace' => 'delete',
373-
'type' => 'DELETE',
374-
'url' => ns()->url( '/api/crud/ns.procurements-products/' . $entry->id ),
375-
'confirm' => [
376-
'message' => __( 'Would you like to delete this ?' ),
377-
],
378-
] );
362+
$entry->action(
363+
label: __( 'Edit' ),
364+
identifier: 'edit',
365+
type: 'GOTO',
366+
url: ns()->url( '/dashboard/' . $this->slug . '/edit/' . $entry->id ),
367+
);
379368

380369
return $entry;
381370
}
@@ -447,13 +436,7 @@ public function getLinks(): array
447436
public function getBulkActions(): array
448437
{
449438
return Hook::filter( $this->namespace . '-bulk', [
450-
[
451-
'label' => __( 'Delete Selected Groups' ),
452-
'identifier' => 'delete_selected',
453-
'url' => ns()->route( 'ns.api.crud-bulk-actions', [
454-
'namespace' => $this->namespace,
455-
] ),
456-
],
439+
// ...
457440
] );
458441
}
459442

0 commit comments

Comments
 (0)