Template Literals

This commit is contained in:
Michał 2024-05-13 12:19:11 +01:00
parent df0563cdf2
commit 8dd6fdaa15

View file

@ -4,7 +4,7 @@ import TestData from "./test-data";
const API_URL = "http://127.0.0.1:8080";
export async function getPopularToday(): Promise<Item[]> {
const response = await fetch(API_URL + "/api/items");
const response = await fetch( `${API_URL}/api/items`);
const { data, error }: JSONResponse = await response.json();
if (response.ok) {