curl --location 'http://localhost:9080/api/v1/register' \
--header 'Content-Type: application/json' \
--data '{
"username": "hidayat",
"password": "pass"
}'
curl --location 'http://localhost:9080/api/v1/login' \
--header 'Content-Type: application/json' \
--data '{
"username": "hidayat",
"password": "pass"
}'
curl --location 'http://localhost:9080/api/v1/questions' \
--header 'Authorization: Bearer {{jwt-token}}' \
--header 'Content-Type: application/json' \
--data '{
"title": "Luhut dan Jokowi",
"question": "Mengapa Luhut diberi banyak jabatan oleh Presiden Joko Widodo?"
}'
curl --location 'http://localhost:9080/api/v1/questions'
curl --location 'http://localhost:9080/api/v1/questions/{{question_id}}'
curl --location --request POST 'http://localhost:9080/api/v1/questions/{{question_id}}/thumbsup' \
--header 'Authorization: Bearer {{jwt-token}}'
curl --location --request POST 'http://localhost:9080/api/v1/questions/{{question_id}}/thumbsdown' \
--header 'Authorization: Bearer {{jwt-token}}'
curl --location --request PUT 'http://localhost:9080/api/v1/questions/{{question_id}}' \
--header 'Authorization: Bearer {{jwt-token}}' \
--header 'Content-Type: application/json' \
--data '{
"title": "update title",
"question": "update question"
}
'
curl --location --request DELETE 'http://localhost:9080/api/v1/questions/{{question_id}}' \
--header 'Authorization: Bearer {{jwt-token}}'
curl --location 'http://localhost:9080/api/v1/questions/{{question_id}}/answers' \
--header 'Authorization: Bearer {{jwt-token}}' \
--header 'Content-Type: application/json' \
--data '{
"answer": "Doi selalu punya cara penyelesaiannya."
}'
curl --location 'http://localhost:9080/api/v1/questions/{{question_id}}/answers'
curl --location 'http://localhost:9080/api/v1/answers/{{answer_id}}'
curl --location --request POST 'http://localhost:9080/api/v1/answers/{{answer_id}}/thumbsup' \
--header 'Authorization: Bearer {{jwt-token}}'
curl --location --request POST 'http://localhost:9080/api/v1/answers/{{answer_id}}/thumbsdown' \
--header 'Authorization: Bearer {{jwt-token}}'
curl --location --request PUT 'http://localhost:9080/api/v1/answers/{{answer_id}}' \
--header 'Authorization: Bearer {{jwt-token}}' \
--header 'Content-Type: application/json' \
--data '{
"answer": "update answer"
}
'
curl --location --request DELETE 'http://localhost:9080/api/v1/answers/{{answer_id}}' \
--header 'Authorization: Bearer {{jwt-token}}'
curl --location 'http://localhost:9080/api/v1/answers/{{answer_id}}/comments' \
--header 'Authorization: Bearer {{jwt-token}}' \
--header 'Content-Type: application/json' \
--data '{
"comment": "Setuju gan."
}'
curl --location 'http://localhost:9080/api/v1/answers/{{answer_id}}/comments'
curl --location 'http://localhost:9080/api/v1/comments/{{comment_id}}'
curl --location --request POST 'http://localhost:9080/api/v1/comments/{{comment_id}}/thumbsup' \
--header 'Authorization: Bearer {{jwt-token}}'
curl --location --request POST 'http://localhost:9080/api/v1/comments/{{comment_id}}/thumbsdown' \
--header 'Authorization: Bearer {{jwt-token}}'
curl --location --request PUT 'http://localhost:9080/api/v1/comments/{{comment_id}}' \
--header 'Authorization: Bearer {{jwt-token}}' \
--header 'Content-Type: application/json' \
--data '{
"comment": "update comment"
}
'
curl --location --request DELETE 'http://localhost:9080/api/v1/comments/{{comment_id}}/' \
--header 'Authorization: Bearer {{jwt-token}}'
curl --location 'http://localhost:9080/api/v1/answers/{{answer_id}}/comments' \
--header 'Authorization: Bearer {{jwt-token}}' \
--header 'Content-Type: application/json' \
--data '{
"comment": "Lu mah setuju setuju aje.",
"parent_comment_id": {{comment_id}}
}'
curl --location 'http://localhost:9080/api/v1/comments/{{comment_id}}/subcomments'
curl --location 'http://localhost:9080/api/v1/comments/{{subcomment_id}}'
curl --location --request POST 'http://localhost:9080/api/v1/comments/{{subcomment_id}}/thumbsup' \
--header 'Authorization: Bearer {{jwt-token}}'
curl --location --request POST 'http://localhost:9080/api/v1/comments/{{subcomment_id}}/thumbsdown' \
--header 'Authorization: Bearer {{jwt-token}}'
curl --location --request PUT 'http://localhost:9080/api/v1/comments/{{subcomment_id}}' \
--header 'Authorization: Bearer {{jwt-token}}' \
--header 'Content-Type: application/json' \
--data '{
"comment": "update comment"
}
'
curl --location --request DELETE 'http://localhost:9080/api/v1/comments/{{subcomment_id}}/' \
--header 'Authorization: Bearer {{jwt-token}}'