Skip to content

Commit

Permalink
refactor: use mysql json shorthand accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
mlbrgl committed Feb 14, 2024
1 parent a670e87 commit 6c8f189
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db/model/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]
)
Expand Down

0 comments on commit 6c8f189

Please sign in to comment.