mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 20:27:23 +00:00
Add tags page.
This commit is contained in:
@@ -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`, {
|
||||
|
Reference in New Issue
Block a user