backend now uses calendar_id and this is the frontend upgrade

- calendar_id is unique and therefore creates less problems
- changing id of DOM from item.name to calendar_id
This commit is contained in:
2020-05-18 23:52:18 +02:00
parent ee54dd5daa
commit 4a8ac52201
7 changed files with 31 additions and 18 deletions

View File

@ -148,15 +148,17 @@ def downloader(user):
@login_required
def user():
if request.method == 'POST':
calName = request.json.get('calendar_id')
color = request.json.get('color')
toggle = request.json.get('toggle')
calId = request.json.get('calendar_id')
color = request.json.get('color', None)
toggle = request.json.get('toggle', None)
print(request.json, flush=True)
if color != None:
Calendar.updateCalendar(current_user.id, calName, color=color)
Calendar.updateCalendar(current_user.id, calId, color=color)
if toggle != None:
Calendar.updateCalendar(current_user.id, calName, toggle=toggle)
Calendar.updateCalendar(current_user.id, calId, toggle=toggle)
# toggle specific calendar of user
elif request.method == 'DELETE':
# do nothing
return 'NONE'