Capstone/ui/controllers/components.go

25 lines
643 B
Go
Raw Normal View History

2023-11-04 23:43:01 -04:00
package controllers
import (
"git.preston-baxter.com/Preston_PLB/capstone/frontend-service/templates"
"github.com/gin-gonic/gin"
)
func GetAddActionForm(c *gin.Context) {
user := getUserFromContext(c)
if user == nil {
log.Warnf("Could not find user in context. Trying to redner Action form")
badRequest(c, "No user available in context")
return
}
2023-11-14 13:48:12 -05:00
accounts, err := mongo.FindAllVendorAccountsByUser(user.Id)
2023-11-04 23:43:01 -04:00
if err != nil {
log.WithError(err).Errorf("Failed to find vendor accounts for: %s", user.Email)
serverError(c, "No user available in context")
return
}
renderTempl(c, templates.DashboardActionModal(accounts))
}