فهرست منبع

fix sort order and hash

Pi 4 ماه پیش
والد
کامیت
bb9a7852de
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      rest/pyapi.py
  2. 1 1
      util-sqlpage/code/recent.sql

+ 1 - 1
rest/pyapi.py

@@ -83,7 +83,7 @@ def get_hash(route):
         assert data['encoding'] == 'base64', f"unsupported encoding: {data['encoding']}"
         data = b64decode(data['data'] + '==')
     elif route == 'code':
-        data = dumps(loads(body['data']), sort_keys=True)
+        data = dumps(loads(body['data']), sort_keys=True).encode('utf-8')
     else:
         data = data.encode('utf-8')
 

+ 1 - 1
util-sqlpage/code/recent.sql

@@ -40,5 +40,5 @@ WHERE (
       ELSE $store = cd.store
     END
 )
-ORDER BY expiry, type, c.hash NULLS FIRST
+ORDER BY expiry, created DESC, type, c.hash NULLS FIRST
 ;