chore: some more clean up
This commit is contained in:
@@ -3,7 +3,7 @@ package model_classes
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"git.andr3h3nriqu3s.com/andr3/fyp/logic/utils"
|
||||
. "git.andr3h3nriqu3s.com/andr3/fyp/logic/db_types"
|
||||
. "git.andr3h3nriqu3s.com/andr3/fyp/logic/utils"
|
||||
)
|
||||
|
||||
@@ -33,7 +33,7 @@ func HandleList(handle *Handle) {
|
||||
Model_id string
|
||||
}
|
||||
|
||||
err = utils.GetDBOnce(c, &class_row, "model_classes where id=$1", id)
|
||||
err = GetDBOnce(c, &class_row, "model_classes where id=$1", id)
|
||||
if err == NotFoundError {
|
||||
return c.JsonBadRequest("Model Class not found!")
|
||||
} else if err != nil {
|
||||
@@ -47,7 +47,7 @@ func HandleList(handle *Handle) {
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
rows, err := utils.GetDbMultitple[baserow](c, "model_data_point where class_id=$1 limit 11 offset $2", id, page*10)
|
||||
rows, err := GetDbMultitple[baserow](c, "model_data_point where class_id=$1 limit 11 offset $2", id, page*10)
|
||||
if err != nil {
|
||||
return c.Error500(err)
|
||||
}
|
||||
@@ -60,7 +60,7 @@ func HandleList(handle *Handle) {
|
||||
|
||||
max_len := min(11, len(rows))
|
||||
|
||||
c.ShowMessage = false;
|
||||
c.ShowMessage = false
|
||||
return c.SendJSON(ReturnType{
|
||||
ImageList: rows[0:max_len],
|
||||
Page: page,
|
||||
|
||||
Reference in New Issue
Block a user