mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
feat: save location mesa_map
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
from django.shortcuts import render,redirect
|
||||
from django.shortcuts import render,redirect, HttpResponse
|
||||
from django.http import JsonResponse
|
||||
|
||||
|
||||
from mesas.models import Mesa
|
||||
|
||||
@@ -19,6 +21,11 @@ def mapMesas(request):
|
||||
mesas = Mesa.objects.all()
|
||||
return render(request, 'mesas_map.html', {'mesas': mesas, 'eixosXY': eixosXY})
|
||||
|
||||
def locationMesa(request, mesaId, location):
|
||||
mesa = Mesa.objects.get(id=mesaId)
|
||||
mesa.location = location
|
||||
mesa.save()
|
||||
return JsonResponse({'status': 'ok'})
|
||||
# def onOffmesa(request):
|
||||
# id = request.POST.get('id-mesa')
|
||||
# mesa_id = int(id)
|
||||
|
||||
Reference in New Issue
Block a user