Skip to content

Commit b717e37

Browse files
authored
Merge pull request #1 from kaelthasmanu/create-file-with-constants
refactor: move API_BASE_URL to constants for better maintainability
2 parents 3a60220 + 194ce98 commit b717e37

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/constants/api.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// src/constants/api.ts
2+
3+
export const API_BASE_URL = "https://flathub.org/api/v2";

src/services/api.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { fetch as tauriFetch } from "@tauri-apps/plugin-http";
2+
import { API_BASE_URL } from "../constants/api";
23
import type {
34
AppOfTheDayResponse,
45
AppStream,
@@ -10,8 +11,6 @@ import type {
1011
SearchResponse,
1112
} from "../types";
1213

13-
const API_BASE_URL = "https://flathub.org/api/v2";
14-
1514
const getTodayDate = (): string => {
1615
const today = new Date();
1716
const year = today.getFullYear();

0 commit comments

Comments
 (0)