init wishlist, zustand and tanstack

This commit is contained in:
Patryk
2025-04-24 23:47:41 +02:00
parent a26873f9e1
commit 6da9c92bca
10 changed files with 354 additions and 52 deletions

View File

@@ -0,0 +1,20 @@
const API_URL = "https://testowe.zikor.pl/api/v1/notices/";
export async function listNotices() {
const response = await fetch(`${API_URL}get/all`);
const data = await response.json();
if (!response.ok) {
throw new Error("Error");
}
return data;
}
export async function getNoticeById(noticeId) {
const response = await fetch(`${API_URL}get/${noticeId}`);
const data = await response.json();
if (!response.ok) {
throw new Error("Error");
}
return data;
}