1
|
import { axiosInstance } from "./api"
|
2
|
|
3
|
|
4
|
export const getPlanAllRequest = async () => {
|
5
|
return await axiosInstance.get(
|
6
|
`/plan/all`
|
7
|
)
|
8
|
}
|
9
|
|
10
|
export const getPlanListRequest = async () => {
|
11
|
return await axiosInstance.get(
|
12
|
`/plan/list`
|
13
|
)
|
14
|
}
|
15
|
|
16
|
export const getPlanFloorImageRequest = async (floorId: string) => {
|
17
|
return await axiosInstance.get(`/downloads/${floorId}`);
|
18
|
}
|
19
|
|
20
|
/*
|
21
|
// inventories
|
22
|
@activeTab: index of selected inventory: result: Inventories (starting from 0)
|
23
|
|
24
|
// pagination
|
25
|
@page: page number (starting from 1) -> current page is returned as result
|
26
|
@items: page size
|
27
|
@cursor: (page - 1) * pageSize ?
|
28
|
|
29
|
|
30
|
// location
|
31
|
@room: id of room in which we are looking for items
|
32
|
@place: id of place inside a room in which we are looking for items
|
33
|
*/
|
34
|
export const getPlanItemsRequest = async (params: { cursor: number, room: number, items?: number, place?: number, inventory?: string}) => {
|
35
|
|
36
|
|
37
|
let url = `search_v2?tabbed=true&room=${params.room}&cursor=${params.cursor}`
|
38
|
|
39
|
if(params.place){
|
40
|
url += `&place=${params.place}`
|
41
|
}
|
42
|
|
43
|
if(params.inventory){
|
44
|
url += `&inventory=${params.inventory}`
|
45
|
}
|
46
|
else{
|
47
|
url += `&activeTab=0`
|
48
|
}
|
49
|
|
50
|
if(params.items){
|
51
|
url += `&items=${params.items}`
|
52
|
}
|
53
|
|
54
|
console.log(url)
|
55
|
|
56
|
return await axiosInstance.get(
|
57
|
url
|
58
|
)
|
59
|
}
|
60
|
|