Skip to content
Snippets Groups Projects

PlanViewPage Base

Merged František Kaiser requested to merge PlanView into dev
8 files
+ 654
0
Compare changes
  • Side-by-side
  • Inline
Files
8
+ 54
0
import { axiosInstance } from "./api"
export const getPlanAllRequest = async () => {
return await axiosInstance.get(
`/plan/all`
)
}
export const getPlanListRequest = async () => {
return await axiosInstance.get(
`/plan/list`
)
}
/*
// inventories
@activeTab: index of selected inventory: result: Inventories (starting from 0)
// pagination
@page: page number (starting from 1) -> current page is returned as result
@items: page size
@cursor: (page - 1) * pageSize ?
// location
@room: id of room in which we are looking for items
@place: id of place inside a room in which we are looking for items
*/
export const getPlanItemsRequest = async (params: {activeTab: number, page: number, room: number, items: number, place?: number, inventory?: string}) => {
let url = `search_v2?activeTab=${params.activeTab}&page=${params.page}&tabbed=true&room=${params.room}&cursor=${(params.page - 1)*params.items}&items=${params.items}`
if(params.place){
url += `&place=${params.place}`
}
if(params.inventory){
url += `&inventory=${params.inventory}`
}
console.log(url)
return await axiosInstance.get(
url
)
}
Loading