mirror of
https://github.com/franjsco/tick3t
synced 2025-06-05 22:19:18 +02:00
improvement: handle status
This commit is contained in:
@@ -12,7 +12,13 @@ export const getTickets = (page = 1, status = '') => {
|
|||||||
headers: header
|
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 => {
|
.then(res => {
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
return res.json();
|
return res.json();
|
||||||
|
Reference in New Issue
Block a user