git add .
git commit -m "feat: improve wheel UI with gold pointer and center circle sync"
This commit is contained in:
@@ -1,20 +1,40 @@
|
||||
const BASE = 'http://127.0.0.1:8000';
|
||||
|
||||
export const getItems = () =>
|
||||
fetch(`${BASE}/user/items`).then(r => r.json());
|
||||
fetch(`${BASE}/user/items`)
|
||||
.then(r => r.json());
|
||||
|
||||
export const spinWheel = () =>
|
||||
fetch(`${BASE}/user/spin`, { method: 'POST' }).then(r => r.json());
|
||||
fetch(`${BASE}/user/spin`, {
|
||||
method: 'POST'
|
||||
}).then(r => r.json());
|
||||
|
||||
export const adminGetItems = () =>
|
||||
fetch(`${BASE}/admin/items`).then(r => r.json());
|
||||
fetch(`${BASE}/admin/items`)
|
||||
.then(r => r.json());
|
||||
|
||||
export const createItem = (title) =>
|
||||
export const createItem = (data) =>
|
||||
fetch(`${BASE}/admin/items`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ title })
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(data)
|
||||
}).then(r => r.json());
|
||||
|
||||
export const updateItem = (id, data) =>
|
||||
fetch(`${BASE}/admin/items/${id}`, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(data)
|
||||
}).then(r => r.json());
|
||||
|
||||
export const deleteItem = (id) =>
|
||||
fetch(`${BASE}/admin/items/${id}`, { method: 'DELETE' }).then(r => r.json());
|
||||
fetch(`${BASE}/admin/items/${id}`, {
|
||||
method: 'DELETE'
|
||||
}).then(r => {
|
||||
if (r.status === 204) return {};
|
||||
return r.json();
|
||||
});
|
||||
Reference in New Issue
Block a user