From 55c2b2b14d0cadf40198db9ee40fcc1565c0a1d4 Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Wed, 17 Sep 2025 14:27:05 +0700 Subject: [PATCH] Fixing json datetime error and add change Listing based on package --- bruno/GeBox/Package/Version/List.bru | 2 +- modules/api/gebox/version.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bruno/GeBox/Package/Version/List.bru b/bruno/GeBox/Package/Version/List.bru index 030a9a0..7e541ef 100644 --- a/bruno/GeBox/Package/Version/List.bru +++ b/bruno/GeBox/Package/Version/List.bru @@ -15,7 +15,7 @@ params:path { } body:json { - {} + {"package":1} } settings { diff --git a/modules/api/gebox/version.py b/modules/api/gebox/version.py index be85d93..913dee9 100644 --- a/modules/api/gebox/version.py +++ b/modules/api/gebox/version.py @@ -41,9 +41,11 @@ class version: def list(self, params): APIADDR = "/api/gebox/package/version/list" response = {} + loggorilla.prcss(APIADDR, "Define Models") + package = params["package" ] self.cursor.execute("BEGIN;") try: - self.cursor.execute("select * from gebox_package_version;") + self.cursor.execute("select `id`, `package`, `version`, DATE_FORMAT(`release`, '%Y-%m-%d %H:%i:%S') AS `release` from gebox_package_version where `package` = %s;", (package,) ) ls = self.cursor.fetchall() loggorilla.prcss(APIADDR, "Set Response") response["status" ] = "success" @@ -68,7 +70,7 @@ class version: key = params["key" ] self.cursor.execute("BEGIN;") try: - self.cursor.execute("select * from gebox_package_version where `id` = %s ;", (key,) ) + self.cursor.execute("select `id`, `package`, `version`, DATE_FORMAT(`release`, '%Y-%m-%d %H:%i:%S') AS `release` from gebox_package_version where `id` = %s ;", (key,) ) row = self.cursor.fetchone() loggorilla.prcss(APIADDR, "Set Response") response["status" ] = "success"