up
This commit is contained in:
@@ -195,11 +195,13 @@ func CreateFase(c *fiber.Ctx) error {
|
||||
return c.Status(500).JSON(fiber.Map{"error": err.Error()})
|
||||
}
|
||||
f.ParseEntregables()
|
||||
_ = models.ActualizarProgresoProyecto(uint(proyID))
|
||||
return c.Status(201).JSON(f)
|
||||
}
|
||||
|
||||
func UpdateFase(c *fiber.Ctx) error {
|
||||
faseID, _ := strconv.ParseUint(c.Params("faseID"), 10, 32)
|
||||
proyID, _ := strconv.ParseUint(c.Params("id"), 10, 32)
|
||||
type Req struct {
|
||||
Nombre string `json:"nombre"`
|
||||
Descripcion string `json:"descripcion"`
|
||||
@@ -241,14 +243,17 @@ func UpdateFase(c *fiber.Ctx) error {
|
||||
if err := models.UpdateProyectoFase(f); err != nil {
|
||||
return c.Status(500).JSON(fiber.Map{"error": err.Error()})
|
||||
}
|
||||
_ = models.ActualizarProgresoProyecto(uint(proyID))
|
||||
return c.JSON(fiber.Map{"ok": true})
|
||||
}
|
||||
|
||||
func DeleteFase(c *fiber.Ctx) error {
|
||||
faseID, _ := strconv.ParseUint(c.Params("faseID"), 10, 32)
|
||||
proyID, _ := strconv.ParseUint(c.Params("id"), 10, 32)
|
||||
if err := models.DeleteProyectoFase(uint(faseID)); err != nil {
|
||||
return c.Status(500).JSON(fiber.Map{"error": err.Error()})
|
||||
}
|
||||
_ = models.ActualizarProgresoProyecto(uint(proyID))
|
||||
return c.JSON(fiber.Map{"ok": true})
|
||||
}
|
||||
|
||||
@@ -257,6 +262,7 @@ func ApplyTemplate(c *fiber.Ctx) error {
|
||||
if err := models.ApplyFaseTemplate(uint(id)); err != nil {
|
||||
return c.Status(500).JSON(fiber.Map{"error": err.Error()})
|
||||
}
|
||||
_ = models.ActualizarProgresoProyecto(uint(id))
|
||||
fases, _ := models.GetFasesByProyecto(uint(id))
|
||||
return c.JSON(fases)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user