From 4f486b46162409205bae47fa4b367cf9e3a61859 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Sat, 22 Jun 2024 23:27:19 +0800 Subject: [PATCH] fix: resolve issue with post slug possibly being empty during wordpress importing Signed-off-by: Ryan Wang --- console/src/modules/wordpress/use-wordpress-data-parser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/src/modules/wordpress/use-wordpress-data-parser.ts b/console/src/modules/wordpress/use-wordpress-data-parser.ts index e7d1f91..7ef4f35 100644 --- a/console/src/modules/wordpress/use-wordpress-data-parser.ts +++ b/console/src/modules/wordpress/use-wordpress-data-parser.ts @@ -165,7 +165,7 @@ export function useWordPressDataParser( post: { spec: { title: post.title, - slug: post["wp:post_name"] + "", + slug: post["wp:post_name"] || post.title, deleted: post["wp:status"] === "trash", publish: publish, publishTime: new Date(post["wp:post_date"]).toISOString(),