Skip to content

Commit

Permalink
Remove one last usage of throwingSaveEntityRecord
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed Mar 16, 2022
1 parent 245ed3a commit 9f847af
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function NewTemplate( { postType } ) {
} ),
[]
);
const { throwingSaveEntityRecord } = useDispatch( coreStore );
const { saveEntityRecord } = useDispatch( coreStore );
const { createErrorNotice } = useDispatch( noticesStore );

async function createTemplate( { slug } ) {
Expand All @@ -93,7 +93,7 @@ export default function NewTemplate( { postType } ) {
slug,
} );

const template = await throwingSaveEntityRecord(
const template = await saveEntityRecord(
'postType',
'wp_template',
{
Expand All @@ -102,7 +102,8 @@ export default function NewTemplate( { postType } ) {
slug: slug.toString(),
status: 'publish',
title,
}
},
{ throwOnError: true }
);

// Navigate to the created template editor.
Expand Down

0 comments on commit 9f847af

Please sign in to comment.