Private
Public Access
lo que es back esta correjido
This commit is contained in:
1 parent
6ed8805e21
commit
9205fea8d8
23 files changed
+486
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package stock
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
dto "repuestera_back/dto/Stock"
|
||||
stocksvc "repuestera_back/services/stock"
|
||||
)
|
||||
|
||||
func AjustarStock(c *gin.Context) {
|
||||
var data dto.AjusteDto
|
||||
if err := c.ShouldBindJSON(&data); err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
resultado, err := nuevoServicio(c).Ajustar(stocksvc.EntradaAjuste{
|
||||
StockID: data.StockID,
|
||||
CantidadReal: data.CantidadReal,
|
||||
Motivo: data.Motivo,
|
||||
Observacion: data.Observacion,
|
||||
})
|
||||
if err != nil {
|
||||
responderError(c, err)
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, resultado)
|
||||
}
|
||||
Reference in new issue
Block a user