Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IT2810 H21
Team 28
project-3
Commits
db2e4b0c
Commit
db2e4b0c
authored
Nov 09, 2021
by
Duvara Nishaharan
Browse files
endret adressen
parent
a8ac9b77
Changes
1
Hide whitespace changes
Inline
Side-by-side
project-3/src/utils/APIUtil.tsx
View file @
db2e4b0c
...
...
@@ -2,7 +2,7 @@ import axios, {AxiosResponse} from 'axios';
import
{
Country
}
from
'
../interfaces/Country
'
;
function
getData
(
query
:
string
):
Promise
<
Country
[]
>
{
return
axios
.
get
(
'
http://it2810-28.idi.ntnu.no:
808
1/graphql?query=
'
+
query
)
return
axios
.
get
(
'
http://it2810-28.idi.ntnu.no:
300
1/graphql?query=
'
+
query
)
.
then
((
response
:
AxiosResponse
)
=>
{
if
(
response
.
data
.
data
.
country
===
null
){
return
[]
...
...
@@ -14,7 +14,7 @@ export function getAllData(filter: string=""): Promise<Country[]> {
return
getData
(
'
{country
'
+
filter
+
'
{name, native, continent, capital, currency, languages}}
'
);
}
function
numberOfResults
(
query
:
string
):
Promise
<
number
>
{
return
axios
.
get
(
'
http://it2810-28.idi.ntnu.no:
808
1/graphql?query=
'
+
query
)
return
axios
.
get
(
'
http://it2810-28.idi.ntnu.no:
300
1/graphql?query=
'
+
query
)
.
then
((
response
:
AxiosResponse
)
=>
{
if
(
response
.
data
.
data
.
TotalCountires
===
null
){
return
0
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment