from django.shortcuts import render
from rest_framework import viewsets
from .models import Seller, Product, Category
from .serializers import SellerSerializer, ProductSerializer, CategorySerializer

def serve_frontend(request, path=''):
    return render(request, 'index.html')

class CategoryViewSet(viewsets.ModelViewSet):
    queryset = Category.objects.all()
    serializer_class = CategorySerializer

class SellerViewSet(viewsets.ModelViewSet):
    queryset = Seller.objects.all()
    serializer_class = SellerSerializer

class ProductViewSet(viewsets.ModelViewSet):
    queryset = Product.objects.all()
    serializer_class = ProductSerializer
