-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from adamgiebl/tag-input
tag input, tags endpoint and tags in the sidebar, ordering by most po…
- Loading branch information
Showing
8 changed files
with
435 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { API_URL } from "./consts"; | ||
|
||
export const fetchTags = async () => { | ||
try { | ||
const response = await fetch(`${API_URL}/tags`, { | ||
credentials: "include", | ||
}); | ||
|
||
if (!response.ok) { | ||
throw new Error("Failed to fetch tags"); | ||
} | ||
|
||
const { tags } = await response.json(); | ||
return tags; | ||
} catch (error) { | ||
console.error("Error fetching tags:", error); | ||
throw error; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.