mirror of
https://github.com/Fluffy-Bean/TastyBites.git
synced 2024-12-28 02:16:07 +00:00
Template Literals
This commit is contained in:
parent
df0563cdf2
commit
8dd6fdaa15
|
@ -4,7 +4,7 @@ import TestData from "./test-data";
|
||||||
const API_URL = "http://127.0.0.1:8080";
|
const API_URL = "http://127.0.0.1:8080";
|
||||||
|
|
||||||
export async function getPopularToday(): Promise<Item[]> {
|
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();
|
const { data, error }: JSONResponse = await response.json();
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
|
|
Loading…
Reference in a new issue