Fakultas Ilmu Komputer UI

Commit 46b7d1ab authored by Usman Sidiq's avatar Usman Sidiq
Browse files

Coldfix Registrasi

parent 3cb4d9b0
......@@ -63,7 +63,7 @@ It will return a json with key:
* `phone_number` : Your phone number
### 4. To register a location:
Make `POST` request to API endpoint `/informasi-lokasi/lokasi/add/` with the following key:
Make `POST` request to API endpoint `/informasi-fasilitas/lokasi/add/` with the following key:
* `name` : location name
* `altitude` : location altitude, a float.
* `longitude` : location longitude, a float.
......@@ -72,7 +72,7 @@ Make `POST` request to API endpoint `/informasi-lokasi/lokasi/add/` with the fol
* `image` : string of sourc image `.jpg`
### 5. To view a location list:
Make `GET` request to API endpoint `/informasi-lokasi/lokasi/list/`. <br>
Make `GET` request to API endpoint `/informasi-fasilitas/lokasi/list/`. <br>
It will return a json list of locations with key:
* `id` : id of location
* `name` : location name
......@@ -83,7 +83,7 @@ It will return a json list of locations with key:
* `image` : string of sourc image `.jpg`
### 6. To view a location details:
Make `GET` request to API endpoint `/informasi-lokasi/lokasi/detail/*nama_lokasi*/`. <br>
Make `GET` request to API endpoint `/informasi-fasilitas/lokasi/detail/*nama_lokasi*/`. <br>
It will return a json with key:
* `name` : location name
* `altitude` : location altitude, a float.
......@@ -93,7 +93,7 @@ It will return a json with key:
* `image` : string of source image `.jpg`
### 7. To register a facility:
Make `POST` request to API endpoint `/informasi-lokasi/lokasi/add-fasilitas/*nama-lokasi*/` with the following key:
Make `POST` request to API endpoint `/informasi-fasilitas/lokasi/add-fasilitas/*nama-lokasi*/` with the following key:
* `tag` : Fasility Tag
* The options are :
* KURSI_RODA = 'KR'
......@@ -121,7 +121,7 @@ Make `POST` request to API endpoint `/informasi-lokasi/lokasi/add-fasilitas/*nam
<b>Add this to your request header. `Authorization` with value `token *your_token_from_request*`</b>
### 8. To see a facility list from a location:
Make `GET` request to API endpoint `/informasi-lokasi/lokasi/list-fasilitas/*nama-lokasi*/`. <br>
Make `GET` request to API endpoint `/informasi-fasilitas/lokasi/list-fasilitas/*nama-lokasi*/`. <br>
It will return a json with the following key:
* `id`: id of the facility
* `nama_lokasi`: location name of the facility
......@@ -137,7 +137,7 @@ It will return a json with the following key:
* `is_verified`: Verified status
### 9. To see a facility details:
Make `GET` request to API endpoint `/informasi-lokasi/lokasi/detail-fasilitas/*nama-lokasi*/*id-fasilitas*/`. <br>
Make `GET` request to API endpoint `/informasi-fasilitas/lokasi/detail-fasilitas/*nama-lokasi*/*id-fasilitas*/`. <br>
It will return a json with the following key:
* `nama_lokasi`: location name of the facility
* `deskripsi`: the description
......@@ -152,7 +152,7 @@ It will return a json with the following key:
* `is_verified`: Verified status
### 10. To update a facility details:
Make `PUT` request to API endpoint `/informasi-lokasi/lokasi/update-fasilitas/*nama-lokasi*/*id-fasilitas*/`. <br>
Make `PUT` request to API endpoint `/informasi-fasilitas/lokasi/update-fasilitas/*nama-lokasi*/*id-fasilitas*/`. <br>
It requires a request with the following key:
* `deskripsi`: the description
* `rating`: rating of the facility. Default is 3
......@@ -164,14 +164,14 @@ It requires a request with the following key:
of the facility could update the facility</b>
### 11. To update a location phone_number:
Make `PUT` request to API endpoint `/informasi-lokasi/lokasi/update-lokasi/*nama-lokasi*/`. <br>
Make `PUT` request to API endpoint `/informasi-fasilitas/lokasi/update-lokasi/*nama-lokasi*/`. <br>
It requires a request with the following key:
* `no_telp`: the description
<b>Make sure you have token it your request header.</b>
<b>Add this to your request header. `Authorization` with value `token *your_token_from_request*`</b>
### 12. To like / dislike a facility:
Make `PUT` request to API endpoint `/informasi-lokasi/lokasi/like-facility/*nama-lokasi*/*operation*/`. <br>
Make `PUT` request to API endpoint `/informasi-fasilitas/lokasi/like-facility/*nama-lokasi*/*operation*/`. <br>
Replace the `operation` with:
* `like` : if you want to like the facility
* `dislike` : if you want to dislike the facility
......
......@@ -89,9 +89,8 @@ def register_user(request):
return JsonResponse({'response' : missing_key_message(str(e))}, status = status.INTERNAL_SERVER_ERROR)
except IntegrityError as e:
return JsonResponse({'response' : 'User is already exist'}, status = status.INTERNAL_SERVER_ERROR)
except MethodNotAllowed :
return JsonResponse({'response' : request_error_message("post")}, status=status.METHOD_NOT_ALLOWED)
@api_view(['GET'])
@authentication_classes([])
@permission_classes([])
......
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