Add Quick Add Tag functionality and improve tag management in Edit and Publish pages

This commit is contained in:
2025-05-31 12:43:08 +08:00
parent 37a3d0e459
commit d597d62c1c
8 changed files with 221 additions and 8 deletions

View File

@@ -330,6 +330,22 @@ class Network {
}
}
async getOrCreateTags(names: string[], tagType: string): Promise<Response<Tag[]>> {
try {
const response = await axios.post(`${this.apiBaseUrl}/tag/batch`, {
names,
type: tagType
})
return response.data
} catch (e: any) {
console.error(e)
return {
success: false,
message: e.toString(),
}
}
}
async getTagByName(name: string): Promise<Response<Tag>> {
try {
const response = await axios.get(`${this.apiBaseUrl}/tag/${name}`)