2023-09-26 20:15:28 +01:00
|
|
|
package models_utils
|
2023-09-21 16:43:11 +01:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
. "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) {
|
|
|
|
_, 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 {
|
|
|
|
fmt.Println("Failed to update model status")
|
|
|
|
fmt.Println(err)
|
|
|
|
panic("TODO handle better")
|
|
|
|
}
|
|
|
|
}
|