-
Notifications
You must be signed in to change notification settings - Fork 90
/
test.js
34 lines (30 loc) · 699 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class Api {
constructor(auth) {
this._credentials = auth
}
// NOT WORKING
getConfig = async (method, body) => {
const config = { method, body: JSON.stringify(body) }
config["headers"] = {
...headers,
...this._credentials,
}
return config
}
// WORKING
getLocations = async ({ flags = [""] }) => {
// some code
}
// NOT WORKING
set params(obj) {
const { latitude, longitude, page = 1, per_page = 3 } = obj
this._coordinates = { latitude, longitude }
this._page = page
this._per_page = per_page
}
// NOT WORKING
get latitude() {
const { latitude } = this._coordinates
return `latitude=${latitude}`
}
}