2023-09-26 20:15:28 +01:00
|
|
|
package models_utils
|
2023-09-21 16:43:11 +01:00
|
|
|
|
|
|
|
import (
|
|
|
|
. "git.andr3h3nriqu3s.com/andr3/fyp/logic/utils"
|
|
|
|
)
|
|
|
|
|
2023-09-26 20:15:28 +01:00
|
|
|
// TODO make this return and caller handle error
|
2023-10-06 12:13:19 +01:00
|
|
|
func ModelUpdateStatus(c *Context, id string, status int) {
|
2024-03-09 09:41:16 +00:00
|
|
|
_, err := c.Db.Exec("update models set status=$1 where id=$2;", status, id)
|
2023-09-21 16:43:11 +01:00
|
|
|
if err != nil {
|
2024-03-09 09:41:16 +00:00
|
|
|
c.Logger.Error("Failed to update model status", "err", err)
|
|
|
|
c.Logger.Warn("TODO Maybe handle better")
|
2023-09-21 16:43:11 +01:00
|
|
|
}
|
|
|
|
}
|