File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -588,9 +588,9 @@ public function register_endpoints() {
588
588
);
589
589
register_rest_route (
590
590
'feedzy/v1 ' ,
591
- '/logs/delete ' ,
591
+ '/logs ' ,
592
592
array (
593
- 'methods ' => 'GET ' ,
593
+ 'methods ' => 'DELETE ' ,
594
594
'callback ' => array ( $ this , 'delete_log_file_endpoint ' ),
595
595
'permission_callback ' => function () {
596
596
return current_user_can ( 'manage_options ' );
Original file line number Diff line number Diff line change @@ -177,12 +177,12 @@ jQuery(function ($) {
177
177
const originalText = _this . html ( ) ;
178
178
_this . attr ( 'disabled' , true ) . addClass ( 'fz-checking' ) ;
179
179
180
- const deleteUrl = new URL (
181
- `${ window . wpApiSettings . root } feedzy/v1/logs/delete`
182
- ) ;
180
+ const deleteUrl = new URL ( `${ window . wpApiSettings . root } feedzy/v1/logs` ) ;
183
181
deleteUrl . searchParams . append ( '_wpnonce' , window . wpApiSettings . nonce ) ;
184
182
185
- fetch ( deleteUrl )
183
+ fetch ( deleteUrl , {
184
+ method : 'DELETE' ,
185
+ } )
186
186
. then ( ( response ) => response . json ( ) )
187
187
. then ( ( response ) => {
188
188
if ( ! response . success ) {
You can’t perform that action at this time.
0 commit comments