package auth

import (
	"github.com/gin-gonic/gin"
	"gorm.io/gorm"
)

func UserScope(c *gin.Context) func(db *gorm.DB) *gorm.DB {
	userId := int(c.GetFloat64("user_id"))
	return func(db *gorm.DB) *gorm.DB {
		return db.Where("user_id", userId)
	}
}
