Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김시환
/
emergency_room_ChatBot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김시환
2022-11-29 17:44:45 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
c4e55670072131351411b6e5a0201e63d2517322
c4e55670
2 parents
ab4ba6a1
2d2999b3
Merge branch 'main' into 'main'
address update See merge request
!13
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
14 deletions
Address.js
Address.js
View file @
c4e5567
...
...
@@ -6,22 +6,30 @@ globalThis.fetch = fetch.fetch;
var
AddressList
=
new
Array
();
function
getAddress
(
currQuery
)
{
fetch
(
'https://dapi.kakao.com/v2/local/search/address.json?'
+
new
URLSearchParams
({
query
:
currQuery
}),
{
method
:
"GET"
,
headers
:
{
"Authorization"
:
"KakaoAK c14234ba46c574c73715276c5644f397"
}
})
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
console
.
log
(
response
)
AddressList
=
data
.
documents
.
map
(({
road_address
})
=>
({
road_address
}));
console
.
log
(
AddressList
)
return
AddressList
})
function
getAddress
(
currQuery
,
cb
=
()
=>
{})
{
setTimeout
(
function
()
{
fetch
(
'https://dapi.kakao.com/v2/local/search/address.json?'
+
new
URLSearchParams
({
query
:
currQuery
}),
{
method
:
"GET"
,
headers
:
{
"Authorization"
:
"KakaoAK c14234ba46c574c73715276c5644f397"
}
})
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
//console.log(response)
AddressList
=
data
.
documents
.
map
(({
road_address
})
=>
({
road_address
}));
//console.log(AddressList)
cb
(
AddressList
);
});
},
100
)
}
/*
getAddress('석수동길', function (address) {
console.log(address[0].road_address.address_name);
})
*/
...
...
Please
register
or
login
to post a comment