Skip to content

Commit

Permalink
Remove hardcoded reference to rest namespace. (#41950)
Browse files Browse the repository at this point in the history
  • Loading branch information
spacedmonkey committed Jun 27, 2022
1 parent afe7165 commit 4e57c0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/editor/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,12 @@ export const trashPost =
.resolveSelect( coreStore )
.getPostType( postTypeSlug );
registry.dispatch( noticesStore ).removeNotice( TRASH_POST_NOTICE_ID );
const { rest_base: restBase, rest_namespace: restNamespace = 'wp/v2' } =
postType;
try {
const post = select.getCurrentPost();
await apiFetch( {
path: `/wp/v2/${ postType.rest_base }/${ post.id }`,
path: `/${ restNamespace }/${ restBase }/${ post.id }`,
method: 'DELETE',
} );

Expand Down

0 comments on commit 4e57c0e

Please sign in to comment.