From 1b396aa71b1013d4941141ca8a66c5829d1fc237 Mon Sep 17 00:00:00 2001 From: Daniel <nieltansah@gmail.com> Date: Fri, 24 Nov 2017 04:41:51 +0700 Subject: [PATCH] WebApp: Add checkAsync --- TugasBesar2_2017/WebApp/src/main/webapp/js/converse.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/TugasBesar2_2017/WebApp/src/main/webapp/js/converse.js b/TugasBesar2_2017/WebApp/src/main/webapp/js/converse.js index 2088c8b..fe413eb 100644 --- a/TugasBesar2_2017/WebApp/src/main/webapp/js/converse.js +++ b/TugasBesar2_2017/WebApp/src/main/webapp/js/converse.js @@ -69,6 +69,15 @@ let converse = function ($http) { } class User extends Account { + async checkAsync (id) { + try { + await $http.get(`${apiUrl}/driver/${id}`) + return true + } catch (e) { + return false + } + } + pickAsync (id) { let data = JSON.stringify({ 'user_id': id -- GitLab