mirror of
https://github.com/franjsco/tick3t
synced 2024-12-27 09:53:37 +01:00
improvement: handle status
This commit is contained in:
parent
180eea3a8f
commit
a552c67602
@ -12,7 +12,13 @@ export const getTickets = (page = 1, status = '') => {
|
||||
headers: header
|
||||
};
|
||||
|
||||
return fetch(`${config.baseURL}tickets?page=${page}&status=${status}`, options)
|
||||
let url = `${config.baseURL}tickets?page=${page}`;
|
||||
|
||||
if (status) {
|
||||
url += `&status=${status}`;
|
||||
}
|
||||
|
||||
return fetch(url, options)
|
||||
.then(res => {
|
||||
if (res.ok) {
|
||||
return res.json();
|
||||
|
Loading…
Reference in New Issue
Block a user