Fakultas Ilmu Komputer UI

Commit 250fdd73 authored by Usman Sidiq's avatar Usman Sidiq
Browse files

[CHORES] Fix conflict and fix some incorrect function in add-komentar views

parents d28846b8 6ebd0e67
Pipeline #44411 passed with stages
in 7 minutes and 8 seconds
......@@ -10,6 +10,8 @@ urlpatterns = [
path('lokasi/add-fasilitas/<str:nama_lokasi>/', views.add_fasilitas, name='add-fasilitas'),
path('lokasi/list-fasilitas/<str:nama_lokasi>/', views.list_fasilitas, name='list-fasilitas'),
path('lokasi/detail-fasilitas/<str:nama_lokasi>/<int:id>/', views.detail_fasilitas, name='detail-fasilitas'),
path('lokasi/add-komentar/<str:nama_lokasi>/', views.add_komentar, name='add-komentar'),
path('lokasi/list-komentar/<str:nama_lokasi>/<int:id>/', views.list_komentar, name='list-komentar'),
path('lokasi/update-fasilitas/<str:nama_lokasi>/<int:id>/', views.update_fasilitas, name='update-fasilitas'),
path('lokasi/like-fasilitas/<str:nama_lokasi>/<int:id>/<str:operation>/', views.update_like_fasilitas, name='update-like-fasilitas'),
path('lokasi/add-komentar/<str:nama_lokasi>/<int:id>/', views.add_komentar, name='add-komentar'),
......
......@@ -236,7 +236,6 @@ def update_like_fasilitas(request, nama_lokasi, id, operation):
except Exception as e:
return JsonResponse({'response': str(e)}, status = 404)
@api_view(['POST'])
@authentication_classes([TokenAuthentication])
@permission_classes([IsAuthenticated])
......@@ -265,7 +264,7 @@ def add_komentar(request, nama_lokasi, id):
def list_komentar(request, nama_lokasi, id):
try:
if request.method == 'GET':
lokasi = Lokasi.objects.get(name = nama_lokasi)
lokasi = Lokasi.objects.get(name=nama_lokasi)
fasilitas = Fasilitas.objects.get(lokasi=lokasi, id=id)
list_komentar = Komentar.objects.filter(fasilitas=fasilitas)
return_json = {}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment