package User

import (
	services "astrology-api/services"
	"net/http"

	"github.com/gin-gonic/gin"
)

func GetUserHome(c *gin.Context) {

	var userID uint = 0
	if userIDValue, exists := c.Get("user_id"); exists {

		userID = userIDValue.(uint)

	}

	response, err := services.GetHomeData(userID)

	if err != nil {
		c.JSON(http.StatusInternalServerError, gin.H{
			"success": false,
			"message": err.Error(),
		})
		return
	}
	c.JSON(200, response)
}