From 8d0a10843603034b7a20cc7160916edc700b4f0d Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Sat, 17 Jul 2021 22:07:17 +0700 Subject: [PATCH] chore: added new api route --- client/src/languages/en.json | 4 ++++ client/src/languages/id.json | 4 ++++ client/src/routes/api.svelte | 11 ++++++----- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/client/src/languages/en.json b/client/src/languages/en.json index 6d574fb..d59b153 100644 --- a/client/src/languages/en.json +++ b/client/src/languages/en.json @@ -84,6 +84,10 @@ "id": { "title": "Get joke by ID", "body": "You'll get consistent joke for every call with the same ID." + }, + "total": { + "title": "Get total number of jokes", + "body": "...in a form of JSON response." } }, "more": "More documentation will soon arrive here..." diff --git a/client/src/languages/id.json b/client/src/languages/id.json index 0742ecf..89bfd66 100644 --- a/client/src/languages/id.json +++ b/client/src/languages/id.json @@ -84,6 +84,10 @@ "id": { "title": "Dapatkan joke berdasarkan ID", "body": "Bapak akan dapat hasil yang konsisten pada setiap request dengan ID yang sama." + }, + "total": { + "title": "Dapatkan total jumlah jokes", + "body": "...dalam bentuk JSON response." } }, "more": "Dokumentasi lebih lanjut akan segera tiba disini..." diff --git a/client/src/routes/api.svelte b/client/src/routes/api.svelte index 7cabf34..002f7fb 100644 --- a/client/src/routes/api.svelte +++ b/client/src/routes/api.svelte @@ -38,12 +38,13 @@

{$_('api.get.id.title')}

{$_('api.get.id.body')}

- GET {env.API_ENDPOINT}/{id} + GET {env.API_ENDPOINT}/id/{id} + +

{$_('api.get.total.title')}

+

{$_('api.get.total.body')}

+ + GET {env.API_ENDPOINT}/total - - -
-

{$_('api.more')}