From 85cf4fe5de2e9f49f03d47cc4d2ef2e4cb63eeb8 Mon Sep 17 00:00:00 2001 From: Matthieu Bergel Date: Tue, 13 Feb 2024 20:08:14 +0000 Subject: [PATCH] refactor: use mysql json shorthand accessor --- db/model/Post.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/model/Post.ts b/db/model/Post.ts index 737f4ba8ca2..6662b337e9d 100644 --- a/db/model/Post.ts +++ b/db/model/Post.ts @@ -160,7 +160,7 @@ export const getPostsFromSnapshots = async ( SELECT * FROM ${postsTable} WHERE status = "publish" AND type IN (?) - ORDER BY JSON_UNQUOTE(JSON_EXTRACT(wpApiSnapshot, '$.date')) DESC; + ORDER BY wpApiSnapshot->>'$.date' DESC; `, [postTypes] )