Add tags page.

This commit is contained in:
2025-05-30 17:39:57 +08:00
parent d4bfb52ef9
commit 4f99bff2f5
15 changed files with 262 additions and 29 deletions

View File

@@ -14,7 +14,7 @@ import {
UserWithToken,
Comment,
CommentWithResource,
ServerConfig, RSort
ServerConfig, RSort, TagWithCount
} from "./models.ts";
class Network {
@@ -284,6 +284,19 @@ class Network {
}
}
async getAllTags(): Promise<Response<TagWithCount[]>> {
try {
const response = await axios.get(`${this.apiBaseUrl}/tag`)
return response.data
} catch (e: any) {
console.error(e)
return {
success: false,
message: e.toString(),
}
}
}
async searchTags(keyword: string, mainTag?: boolean): Promise<Response<Tag[]>> {
try {
const response = await axios.get(`${this.apiBaseUrl}/tag/search`, {